Making Javascript just write the content
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > IIS server support > IIS ASP > Making Javascript just write the content




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Making Javascript just write the content  
Laphan


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-18-06 12:24 PM

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
size=4>ffff</FONT></P>
<P align=center><FONT face=Arial size=4>777</FONT></P>');
iView.document.close();

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
size=4>ffff</FONT></P>');
iView.document.close();

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.

Thanks

Laphan








[ Post a follow-up to this message ]



    Re: Making Javascript just write the content  
Anthony Jones


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-18-06 06:19 PM


"Laphan" <info@SpamMeNot.com> wrote in message
news:%23mP5$brkGHA.2200@TK2MSFTNGP05.phx.gbl...
> 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!!
>

Nope it isn't

> My code is simply:
>
> iView.document.write('<P align=center><FONT face=Arial
> size=4>ffff</FONT></P>
> <P align=center><FONT face=Arial size=4>777</FONT></P>');
> iView.document.close();
>
> 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
> size=4>ffff</FONT></P>');

I assume that when you posted this it was all on one line.

> iView.document.close();
>
> 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.
>
> Thanks
>
> Laphan

First off this doesn't seem like a sound design.  However you could force it
to one line by replacing vbCr with "\r" and vbLF with "\n" (you probably
should replace ' with ').  This would create a string that would all be on
one line.  How long the line is allowed to be and whether it is sensible to
have a very long line I don't know.  It should work though.








[ Post a follow-up to this message ]



    Re: Making Javascript just write the content  
Laphan


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-18-06 06:19 PM

Many thanks for all of your info and help Anthony

Rgds

Laphan


"Anthony Jones" <Ant@yadayadayada.com> wrote in message
news:OrDb5OukGHA.1000@TK2MSFTNGP04.phx.gbl...

"Laphan" <info@SpamMeNot.com> wrote in message
news:%23mP5$brkGHA.2200@TK2MSFTNGP05.phx.gbl...
> 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!!
>

Nope it isn't

> My code is simply:
>
> iView.document.write('<P align=center><FONT face=Arial
> size=4>ffff</FONT></P>
> <P align=center><FONT face=Arial size=4>777</FONT></P>');
> iView.document.close();
>
> 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
> size=4>ffff</FONT></P>');

I assume that when you posted this it was all on one line.

> iView.document.close();
>
> 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.
>
> Thanks
>
> Laphan

First off this doesn't seem like a sound design.  However you could force it
to one line by replacing vbCr with "\r" and vbLF with "\n" (you probably
should replace ' with ').  This would create a string that would all be on
one line.  How long the line is allowed to be and whether it is sensible to
have a very long line I don't know.  It should work though.









[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:52 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register