Common sources of unterminated string literal [duplicate]

Most browsers seem to have problems with code like this:

var foo = "</script>";

In Firefox, Opera and IE8 this results in an unterminated string literal error. Can be pretty nasty when serializing html code which includes scripts.

Leave a Comment