Simon Willison’s Weblog


Interesting but ultimately useless

22nd November 2002

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).

This is Interesting but ultimately useless by Simon Willison, posted on 22nd November 2002.

Next: Aquari-gone-ics

Previous: Mark's tinkerings

Previously hosted at