Interesting but ultimately useless
Via Stuart, Tantek has an intriguing new (valid) hack for adding HTML documentation to an external javascript file. The hack uses some clever multi-language comments to hide the HTML in the file from the script interpreter, while ensuring that the documentation remains readable when the file is interpreted as HTML. Unfortunately the trick does not work in Mozilla, as that browser respects the Content-Type served with the document (whereas IE “guesses” the content is HTML from clues in the document).
Actually, IE6/XP shows a "Save As" dialog box as well. So does Netscape 4.x. Quite rightfully so, I'd say. The Content-Type is text/* - why not text/javascript? (Even then I doubt correct browsers would show the HTML).
Oh, it /does/ work in Opera 6.
(Unrelated - Simon: oculd you add <label /> elements for the Yes/No cookie option? You've got a silly label for "Remeber details" now.)
Jan! - 23rd November 2002 14:04 - #
Jan! - 23rd November 2002 14:07 - #
Simon Willison - 23rd November 2002 20:01 - #