我正在使用下面的 JS 代码通过填充动态生成的代码来打开新窗口..
function OpenWindow(obj) {
var w = window.open();
var stored = $(obj).parent().find("div").html();
w.document.title = "New Window";
w.document.URL = "hello.com/dummypage.html"; //how to assign the url to the newly opened window
$(w.document.body).html(stored);
return false;
}
本文档中使用的相对 url 表示 for img src
, 在本文档中不起作用。
<tr><td colspan='2' align='center'><img id='imglegend' src='/images/Legend.jpg'></td></tr>
编辑:
我使用 javascript 动态填充内容,只需要浏览器窗口中的有效 url,就可以使我的超链接和图像源引用工作。
PS js代码中指出的页面,并不存在。