[thelist] Javascript not validating
Paul Bennett
paul at web-business-pack.com
Thu Sep 23 15:06:33 CDT 2004
<script type="text/javascript" src="myfile.js>doDocWrite();
</script>
=====================================
contents of myfile.js:
function doDocWrite()
{
docContent = '<a href="javascript:forward2()">';
docContent += '<img src="/images/home/random/R';
docContent += which;
docContent += '.jpg" width="331" height="199" border="0" id="photoslider" alt="Click to view next image"></a>';
document.write(docContent);
}
======================================
HTH
Paul B
Kevin Switzer wrote:
>I have the following code in a page, and the HTML is not validating....
>
>
>
><script language="JavaScript" type="text/javascript">
>
><!--
>
>document.write('<a href="Javascript:forward2()"><img
>src="/images/home/random/R'+which+'.jpg" width="331" height="199"
>border="0" id="photoslider" alt="Click to view next image"></a>');
>
>//-->
>
></script>
>
>
>
>
>
>The W3C HTML Validator gives me this error:
>
>
>
>1. Line 77, column 182: end tag for element "A" which is not open
>
>...r" alt="Click to view next image"></a>');
>
>
>
>Any ideas on how I can fix this??
>
>
>
More information about the thelist
mailing list