Making Javascript just write the content

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Hi All

I'm using ASP to squirt some text into JS so that the JS write it into an
iFrame, but JS keeps giving me unterminated string errors when the text is
more than 1 line's worth.  I thought JS was free-form!!

My code is simply:

iView.document.write('<P align=center><FONT face=Arial
<P align=center><FONT face=Arial size=4>777</FONT></P>');

All of the content between the '..'' in the .write is what comes from my DB
via ASP.

If the content came out as:

iView.document.write('<P align=center><FONT face=Arial

then it works.  AAARRRRGGGHHHH!!

Could somebody please advise me on how get JS to work with a (possibly)
large chunk of data with the above.



Re: Making Javascript just write the content

Quoted text here. Click to load it

Hi Laphan,
In your ASP code, can you run a regex to replace newlines with the
string " \n "?

Philip /
Bulk HTML validation, link checking and more

Site Timeline