document.form1.html_code.value="<html>\n\n<head>\n <title>My Home
Page</title>\n</head>\n\n<body>\n<p><img src=\"newspaper.gif\" width=\"44\"
height=\"36\" alt=\"A Newspaper\">\nSee the image to the left of this
sentence?</p>\n</body>\n\n</html>";
It's perfectly legall javascript and I use it to fill the value of a text
area. However I get all kinds of errors when I try to validate the page at
w3c casue it thinks that stuff is html code which it looks like ti but it is
actually contained in a javascript string. Should I just ignore this and
consider my page validated?
Thanks
Adam
Try moving the JS functions into a separate
".js" file. Also try moving the long strings into variables
and set the document.formX.html_code.values to those variables.
> actually contained in a javascript string. Should I just ignore this and
> consider my page validated?
No. You should read the FAQ, and fix the error.
--
Nick Kew
Site Valet - the mark of Quality on the Web.
<URL:http://valet.webthing.com/>
No it correctly detects that the script element is closed;
you need to escape all slashes of closing tags within the string with
backslashes, like <\/title>
Eric B. Bednarz from alt.html found out what is was. I needed to escape my
forward slahes in the string. Validates fine now thanks.
When you start and end your script...
Replace:
<script type="text/javascript">
...
</script>
with:
<script type="text/javascript"><!--
...
// -->
</script>
--
Keep your web authoring ahead of deprecation.