By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,442 Members | 1,312 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,442 IT Pros & Developers. It's quick & easy.

Writing to popups

P: n/a
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?
Nov 13 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
Nov 14 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.