是否可以使用 DOM windows.location 将网页加载到 iframe 中?或其他方式,例如:
...
document.getElementByID("content").innerHTML ="http://google.com";
...
<div id="content"></div>
谢谢
你缺少的可能是 iframe 的.src
属性:
document.getElementByID("content").src = "http://google.com";
(假设"内容"是内框的 ID)