Writing to popups

W

webmaniac

Hi,

I am trying to write the content of one html page to another. But the
problem is it overwrites everything that other html page has.
For Example, I have two pages. One is 1.html & second is 2.html. There
is a div in 1.html. I want to write that div contents to 2.html.
2.html has some content in it. But when I write to 2.html, the div
content is overwriting everything that is in 2.html and I dont want to
do that.
I am using this to write:
printWin = window.open("2.html","printSpecial");
printWin.document.open();
printWin.document.write(html);
printWin.document.close();

Any Ideas what I am doing wrong here?
 
E

Erwin Moller

webmaniac schreef:
Hi,

I am trying to write the content of one html page to another. But the
problem is it overwrites everything that other html page has.
For Example, I have two pages. One is 1.html & second is 2.html. There
is a div in 1.html. I want to write that div contents to 2.html.
2.html has some content in it. But when I write to 2.html, the div
content is overwriting everything that is in 2.html and I dont want to
do that.
I am using this to write:
printWin = window.open("2.html","printSpecial");
printWin.document.open();
printWin.document.write(html);
printWin.document.close();

Any Ideas what I am doing wrong here?

Hi,

You probably closed the document before writing to it.
Once closed, subsequent open/write class will start on empty document.

Solution: do not close.

Regards,
Erwin Moller

--
"There are two ways of constructing a software design: One way is to
make it so simple that there are obviously no deficiencies, and the
other way is to make it so complicated that there are no obvious
deficiencies. The first method is far more difficult."
-- C.A.R. Hoare
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top