I'm trying to add some content into a page that is opened in a new tab/window, and nothing seems to be happening. Here is some of my code:
var newWindow = window.open('/Window');
newWindow.document.body.innerHTML += '<div>This is a test</div>';
Any ideas?
as you have tagged jquery:
var w = window.open();
var html = '<div>This is a test</div>';
$(w.document.body).html(html);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.