Hello,
I am trying to make my html validate against XHTML 1.0 Transitional.
The validator is choking on this piece of code
Its saying:
Line 44 is the first element of the messpic array declaration (red in the code above). It appears to not like my img tag and I cannot figure out what it doesn't like about it. Does anyone have any ideas?
The page resides at Any help would be greatly appreciated...
I am trying to make my html validate against XHTML 1.0 Transitional.
The validator is choking on this piece of code
Code:
<div id="hpMain">
<p>
<script type="text/javascript">
var messpic = new Array(
[COLOR=red]"<img id='homepagePic' src='/images/homepage1.jpg' alt='Main Home Page Image' border='0' />",[/color]
"<img id='homepagePic' src='/images/homepage2.jpg' alt='Main Home Page Image' border='0' />",
"<img id='homepagePic' src='/images/homepage3.jpg' alt='Main Home Page Image' border='0' />",
"<img id='homepagePic' src='/images/homepage4.jpg' alt='Main Home Page Image' border='0' />",
"<img id='homepagePic' src='/images/home_page5.jpg' alt='Main Home Page Image' border='0' />",
"<img id='homepagePic' src='/images/homepage5.jpg' alt='Main Home Page Image' border='0' />",
"<img id='homepagePic' src='/images/homepage6.jpg' alt='Main Home Page Image' border='0' />",
"<img id='homepagePic' src='/images/homepage7.jpg' alt='Main Home Page Image' border='0' />");
var max = messpic.length;
var num = Math.floor((Math.random() * max));
document.writeln(messpic[num]);
</script>
<noscript>
<img id="homepagePic" src="/images/home_page5.jpg" border="0" alt="Students" align="bottom" />
</noscript>
Its saying:
Code:
Error Line 44 column 90: document type does not allow element "img" here.
...t='Main Home Page Image' border='0' />",
The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).
One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).
Line 44 is the first element of the messpic array declaration (red in the code above). It appears to not like my img tag and I cannot figure out what it doesn't like about it. Does anyone have any ideas?
The page resides at Any help would be greatly appreciated...