SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
-
Dec 22, 2003, 11:41 #1
- Join Date
- Dec 2003
- Location
- brazil
- Posts
- 4
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
??how to define a very large string var
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 takes many lines '
this produces the (unterminated string constant)
any idea?
-
Dec 22, 2003, 13:46 #2
- Join Date
- Jan 2003
- Location
- Calgary, Canada
- Posts
- 2,063
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
that's because in javascript, string declarations cannot span multiple lines.
You'll need to replace all the linebreaks in PHP with \nWho walks the stairs without a care
It shoots so high in the sky.
Bounce up and down just like a clown.
Everyone knows its Slinky.
Bookmarks