Re: document.write and validation
by "Justin H." <justinh(at)whidbey.net>
|
Date: |
Mon, 12 Mar 2001 09:05:24 -0800 |
To: |
"HWG Techniques" <hwg-techniques(at)hwg.org> |
References: |
tim |
|
todo: View
Thread,
Original
|
|
Use HTML comment tags to hide the scripting from validators (and javascript
non-compliant browsers, too).
<.SCRIPT TYPE="text/javascript">
<.!--
...javascript here
//-->
<./SCRIPT>
Justin H.
----- Original Message -----
From: "tim booker" <timbooker(at)btinternet.com>
Subject: document.write and validation
> Hello All,
>
> When I try to validate a page that uses document.write to insert HTML, the
> W3C validator gives me an error.
>
> For example, if I had:
>
> document.write('<a href="'index.html">click here</a>');
>
> The validator doesn't seem to see the opening tag, and so reports an error
> when it sees the closing.
>
> Is that section of JavaScript invalid? Or, is it a problem with the
> validator that causes it not to see the opening tag?
>
> How can I get around this validation problem?
>
> Tim
>
>
> www.timbooker.com
>
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA