Link to home
Start Free TrialLog in
Avatar of lennyh
lennyhFlag for United States of America

asked on

document.write() alternative?

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?
Avatar of Grdv
Grdv

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
Avatar of lennyh

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of Grdv
Grdv

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lennyh

ASKER

Grdv, thanks for your clear and responsive answer.