SledgeHammer
2007-04-01, 10:06
When I run my website through the W3C's HTML validator, I get 3 errors. They are all the same error, and I think I know why they are occurring, but I don't know if I can fix them.
The error is "document type does not allow element "img" here." All three instances of the error occur in the section below:
<script language="javascript" type="text/javascript">
if (navigator.appName != "Microsoft Internet Explorer")
{document.write("<img src='images/homeheadtop.gif' alt='Frodos Notebook' height='126' width='630' /> <img src='images/headtail.gif' alt=' ' class='head' />")}
if (navigator.appName == "Microsoft Internet Explorer")
{document.write("<img src='images/iehead.gif' alt='Frodos Notebook' width='630' />")}
</script>
I assume the problem comes from the tags being inside the script, but I was hoping there was a way I could keep the functionality and still get the site to validate.
The site in question. (http://www.frodosnotebook.com)
The validator results page. (http://validator.w3.org/check?uri=http%3A%2F%2Fwww.frodosnotebook.com%2F&charset=%28detect+automatically%29&doctype=Inline)
The error is "document type does not allow element "img" here." All three instances of the error occur in the section below:
<script language="javascript" type="text/javascript">
if (navigator.appName != "Microsoft Internet Explorer")
{document.write("<img src='images/homeheadtop.gif' alt='Frodos Notebook' height='126' width='630' /> <img src='images/headtail.gif' alt=' ' class='head' />")}
if (navigator.appName == "Microsoft Internet Explorer")
{document.write("<img src='images/iehead.gif' alt='Frodos Notebook' width='630' />")}
</script>
I assume the problem comes from the tags being inside the script, but I was hoping there was a way I could keep the functionality and still get the site to validate.
The site in question. (http://www.frodosnotebook.com)
The validator results page. (http://validator.w3.org/check?uri=http%3A%2F%2Fwww.frodosnotebook.com%2F&charset=%28detect+automatically%29&doctype=Inline)