Mesmeric - 2007-12-29


When you use the Javascript line continuation character \ to end a line so it is combined with the next into a single line, if this is done in the midst of a string then instead of the next line being styled as part of a string, it is treated to a standard syntax styling and there are sometimes knock-on effects when the string does close.
A quick test seems to suggest this occurs when Javascript is used in a PHP and HTML styled page environment but not in a pure Javascript style page.

For example choose a PHP styler and paste this as a document:

<script language='JavaScript' type="text/javascript">
document.write("hello this \ is the world");

If you change the language to Javascript you'll see it now gets it right.

Many thanks indeed to all,