[英]How can I add content to a page after opening the link in a new window/tab?
我正在嘗試將一些內容添加到在新標簽頁/窗口中打開的頁面中,似乎什么也沒有發生。 這是我的一些代碼:
var newWindow = window.open('/Window');
newWindow.document.body.innerHTML += '<div>This is a test</div>';
有任何想法嗎?
如您所標記的jquery:
var w = window.open();
var html = '<div>This is a test</div>';
$(w.document.body).html(html);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.