[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

document.write() alternative?

Posted on 1998-10-29
4
Medium Priority
?
369 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 400 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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…
Suggested Courses

825 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