473,657 Members | 2,727 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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><F ONT face=Arial
size=4>ffff</FONT></P>
<P align=center><F ONT 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><F ONT 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 1346

"Laphan" <in**@SpamMeNot .com> wrote in message
news:%2******** ********@TK2MSF TNGP05.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><F ONT face=Arial
size=4>ffff</FONT></P>
<P align=center><F ONT 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><F ONT 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*@yadayadaya da.com> wrote in message
news:Or******** ******@TK2MSFTN GP04.phx.gbl...

"Laphan" <in**@SpamMeNot .com> wrote in message
news:%2******** ********@TK2MSF TNGP05.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><F ONT face=Arial
size=4>ffff</FONT></P>
<P align=center><F ONT 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><F ONT 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
2758
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 and goes to the index file again, I can't figure out how it opens the chatroom. I want to get it to skip the login box and go straight to the room, with user name "guest" or "" or whatever but I'll add a field to type the name in the chat room....
4
4257
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) and puts values in a number of arrays and then puts the contents of the array in a HTML table. I'd like to keep the array structure. I've checked out all sorts of different javascript parsers but have not met with a great deal of success with any...
26
15216
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 "locate.replace". I can do all this if the html page containing the script originates on the client machine, but don't know how to get access to a client-side temp file when the same html page containing the script is on a web host. How do I get access...
2
2053
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 block does its own document.write of one last script block "Block C". The way this occurs is somewhat out of my control, and I need to find a way to work within this framework. This only needs to work in IE 5.5 or better. My problem is that the...
4
3403
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 write and it works fine until she puts it into a function and then calls the function from a button with onClick. This also seems to work OK, with the exception that the page is cleared, and the curser changes (and stays) as an hourglass. In...
4
2321
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
1298
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 JS was free-form!! My code is simply: iView.document.write('<P align=center><FONT face=Arial size=4>ffff</FONT></P>
2
5403
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! The 'floating layer' does not float in IE7... it just sits up at the top of the screen - stuck in one place!! Explorer - why do you mock us?!!! ;( I have tried everything - but I am at a loss. I am thinking maybe it's some conflicting CSS or some...
1
1776
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 loaded dynamically (and using a fade effect) into a placeholder div using AJAX. This is all working fine, however the tricky part for me is making the site accessible by using unobtrusive javascript. What I want to do for users with javascript...
0
8825
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7327
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6164
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.