Is there any reason for this to break? Well, it does. Firefox says this:
In Story JavaScript Eval(): SyntaxError: "" literal not terminated before end of script
This is a minimal example. In real use I put a lot of things between the script tags, and then the function prints that to the screen. This kind of function has worked for me many times, and I don’t understand why it’s failing now.
The Story JavaScript gets put in a <script> tag, and in HTML, the contents of scripts are treated as plain text, and the characters</ must not appear except as part of the </script> tag which ends the script section. So you need to break up any </ somehow. If it’s in a JavaScript string, the easiest thing is to put a backslash before the slash, like:
If you’re not writing a </script> tag you might be able to get away without breaking the </ pair: browsers are pretty lenient usually. But you’ll probably get some sort of warning message somewhere.
Edit: I’m not sure why this sort of thing worked for you before, sorry. That’s very weird: AFAIK it should always have broken…