473,378 Members | 1,368 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Making Javascript just write the content

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

Jun 18 '06 #1
2 1325

"Laphan" <in**@SpamMeNot.com> wrote in message
news:%2****************@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.

Jun 18 '06 #2
Many thanks for all of your info and help Anthony

Rgds

Laphan
"Anthony Jones" <An*@yadayadayada.com> wrote in message
news:Or**************@TK2MSFTNGP04.phx.gbl...

"Laphan" <in**@SpamMeNot.com> wrote in message
news:%2****************@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.


Jun 18 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: |-|erc | last post by:
Hi! Small challenge for you. The index.php uses this file and calls layout(). Take a look at www.chatty.net this file draws the chat login box on the right. I traced the CHAT button it submits...
4
by: annoyingmouse2002 | last post by:
Hi there, sorry if this a long post but I'm really just starting out. I've been using MSXML to parse an OWL but would like to use a different solution. Basically it reads the OWL (Based on XML)...
26
by: Don | last post by:
I'm writing an html page with some JavaScript that reads a web page into a client-side temp file, then reformats it, then submits that same file as a URL to the browser for display, via...
2
by: thinkfr33ly | last post by:
I have a page that inserts a block of javascript dynamically into the page "Test.html". The inserted block, "Block A", then does a document.write of another script block "Block B". This script...
4
by: frogman042 | last post by:
My daughter is playing around trying to learn JavaScript and she wrote a small program that prints out a message in increasing and decreasing font size and color changes. She is using document...
4
by: lmarceglia | last post by:
Hi, I have this website that doesn't work in Firefox 1.5: www.pianetaluca.com The HTML source is: <TITLE>PianetaLuca</TITLE> </HEAD>
1
by: Laphan | last post by:
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...
2
by: Head In A Pan | last post by:
Hello! My JavaScripting is at novice level - and after completing a tutorial on a 'floating layer' I was proud that I got it working on Firefox, Safari, Camino & even IE5 for mac!!! But not IE7!...
1
by: nicky77 | last post by:
Hi, apologies in advance is this may be a nonsensical ramble, but I'm hoping someone can give me some advice on how to solve the following problem: I'm developing a site where the main content is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.