[Javascript] String on multiple lines

Scott Reynen scott at randomchaos.com
Wed Jun 21 11:15:50 CDT 2006


On Jun 21, 2006, at 12:13 AM, Peter Lauri wrote:

>> I'd try escaping the PHP line break

> This did it, but with PHP :)
>
> No Javascript solution?

Here's my understanding of why you can't do this: a JavaScript  
runtime does two things to code.  First, it parses it.  Then, it  
executes it.  Line breaks indicate the end of a line of code in  
JavaScript, and a line of code can't end with a string open, so the  
parsing fails.  So you can't solve this problem with JavaScript code,  
because JavaScript never gets to the step of executing the code.

Peace,
Scott




More information about the Javascript mailing list