Forum Moderators: open
now I used a trick; but is it a correct way of dealing with the problem?
I removed my JS scripts and use a library to call the scripts,
<script type="text/javascript" src= "library/indexdex.js"></script>
indeed now my page validates :)
any inputs or advice
thanks
regards
Henry
Example: in
document.write('<a href="some.html">go</a>');
the </ will be interpreted by the validator (and ancient or sgml-strict browsers) as an effort to close the <script>-tag. So you should escape it:
document.write('<a href="some.html">go<\/a>');
But, just FYI on inline scripts, if you comment your script blocks you shouldn't have a problem with the validators.
<script type="text/javascript">
<!--
//-->
</script>
The comment will cause the validator to skip from the opening script tag to the closing one w/o trying to evaluate ythe script inside them as HTML.
Jordan