[links-list] Re: Cookies

Jonas Fonseca fonseca at diku.dk
Sat May 4 07:03:11 PDT 2002

On Sat, May 04, 2002 at 10:26:09AM +0400, Khimenko Victor wrote:
> > Is this hook able to handle this piece of (I think) legal javascript
> > code as well ?
> >
> You think wrong. While it's legal javascript it's illegal HTML with
> JavaScript :-)

Ok I got carried away a bit there. Sorry. :)
But if this javascript code 

<SCRIPT type="text/javascript">
	document.write ("<EM>This will work<\/EM>")

taken from here[1] is valid. And links handles this ok

	<script>document.write('<p> This is ignored.');</script>
	<noscript><p> This is displayed. </noscript>

Then why can't it handle this ?

	<script>document.write('<td> This is troublesome.');</script>
	<noscript><td> This should be diplayed but is not. </noscript>

So it's ok to have <p> tags inside <script> strings but not <td>. 
Is <td> handled in a special way ? Well I'm possibly missing the point.

Another little strange behaviour I observed was that if two of the
troublesome pieces of code is placed after another the second is handled
alright. So it seems two wrongs make a right. Now that's a feature! ;)

> Most browsers (even where JavaScript is supported) will FIRST cut part of
> HTML from <script> to </script> and THEN try to interpret it. It's
> explained in all good manuals about JavaScript and both MS IE and Netscape
> will interpret as JavaScript only part from <script> to quoted </script>
> and the reas you'll see in browser window...

Point taken. :) But if all HTML is cut out then it's not handled the [1] 
specified way. And the examples above clearly shows that links is not
doing either but a mix of both.

> Well - we can be glad Netscape and followers put this burden on
> web-masters and not on web-browsers ...

Well I agree. Another question is how tolerant browsers should be toward
invalid code. I think we agree on the web is full of crappy code what is
links policy on this matter ?

[1] http://www.w3.org/TR/WD-html40-970708/interact/scripts.html#h-
Jonas Fonseca
Unsubscribe: send email to links-list-request at linuxfromscratch.org
and put unsubscribe in the subject header of the message

More information about the links-list mailing list