Reputation: 625
I have already opened child window by following code
var myWindow = window.open('','','width=1250,height=1000,resizable=yes,fullscreen=yes');
var doc = myWindow.document;
doc.open();
doc.write(divText);
doc.close();
now I am trying to update the html of that already opened myWindow
. How will I be able to do that?
Upvotes: 0
Views: 446
Reputation: 69367
You don't need to do doc.open()
and doc.close()
.
You can do the following:
var myWindow = window.open('','','width=1250,height=1000,resizable=yes,fullscreen=yes');
var doc = myWindow.document;
doc.body.innerHTML = divText;
// Then, when you want, change it:
doc.body.innerHTML = "Something else";
Upvotes: 2