Click to See Complete Forum and Search --> : ??no way to define multi-line vars


lisawebs
12-22-2003, 12:53 PM
I need to pass a large string from PHP into Jscript var,
but the following isn't accepted:

text = 'a very large string for a text box which comes with line breaks an so it takes many lines '

this produces the error (unterminated string constant)

any idea?

ray326
12-22-2003, 03:38 PM
If it takes many lines and you know where the line breaks are then turn the lines into separate strings and concatenate them with a +.

"this all looks "+
"like one big string "+
"to Javascript."