Solved

document.write() alternative?

Posted on 1998-10-29
4
358 Views
Last Modified: 2008-03-10
Using Javascript, I want to be able to collect multiple screens of information from user forms in cases where I don't have to go back to the host.  So I want to replace existing windows with new ones based on info from the form.  For small amounts of information, building new screens with document.write() works OK.  But, using document.write() for large amounts of info is clumsy (everything needs to be squished up on a single line)  Is there some other way to do this, or is there some way to use document.write() w/o having to squish up everything?
0
Comment
Question by:lennyh
  • 2
  • 2
4 Comments
 
LVL 2

Expert Comment

by:Grdv
ID: 1273179
well, without squishing:
var tmptext='<body bgcolor="black" text="white">'
tmptext+='<table border=1 cellspacing=0 cellpadding=0>'

//and so on... note the use of single quotes to enable double qoutes inside...

document.write(tmptext);
if that was what you meant...
another way of doing it is to use something like this:
var tmpwindow = window.open('') // **not sure about this one
tmpwindow.location=tmptext; //tmptext is the same as above...


**not sure about this one: why? well I'm not sure that's the way of opening up nothing in the current frame, but if it's a specific frame, and you know the name of it, the line should be:
var tmpwindow = window.open('','**framename**') // ** sure about this one
where **framename** represents the frames name.

hope it helped

//Grdv
0
 

Author Comment

by:lennyh
ID: 1273180
Grdv,

Thanks for your response.  Sure seems like that will work.  Still a tiny bit clumsy, but a whole lot better than what I was trying to do.

I'll take it.

Regards,

Lenny
0
 
LVL 2

Accepted Solution

by:
Grdv earned 100 total points
ID: 1273181
oops, was supposed to be posted as an answer... :)
well, the most important thing is that you got what you needed

//Grdv
0
 

Author Comment

by:lennyh
ID: 1273182
Grdv, thanks for your clear and responsive answer.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now