[BUG] Squeak3.1beta Scamper error opening SqueakLand.org

Ned Konz ned at bike-nomad.com
Mon Oct 22 17:53:09 UTC 2001


On Monday 22 October 2001 10:37 am, I wrote:
> On Monday 22 October 2001 09:03 am, I wrote:
> > Line 153 should probably have been broken up into two write() calls to
> > avoid confusing the parsers:
> >
> > document.write("//--"); document.write("></style>");
>
> Sorry, the end-of-comment string is '--' not '-->' so that should be:
>
> document.write("//-"); document.write("-></style>");

Even more fun... from the HTML 4.0 spec:

Technically, the first occurrence of "</" followed by any letter is 
considered the end tag for the SCRIPT element. While browsers are forgiving 
in this, authors should avoid using strings such as "</P>" in their embedded 
scripts. JavaScript allows authors to use a backslash to avoid ending the 
SCRIPT element prematurely, e.g., document.write("<\/P>").

So it would be better to do this:

document.write("//\-\-><\/style>");

If you include the fact that some older browsers terminated comments on the 
first ">", you'd have to quote the '>' characters:

document.write("//\-\-\x3e<\/style\x3e");

isn't HTML fun!

-- 
Ned Konz
currently: Stanwood, WA
email:     ned at bike-nomad.com
homepage:  http://bike-nomad.com




More information about the Squeak-dev mailing list