【发布时间】:2012-09-25 14:30:30
【问题描述】:
我想要“重新加载”按钮并在单击 Windows Metro Style App 时重新加载 iframe 的内容。 当我单击该按钮时,出现 Javascript 运行时错误,并表示没有写入权限。
源码如下:
== default.html ==
<iframe id="iframe" src="http://example.com" width="800px" height="400px"></iframe>
<button id="reloadButton">Reload</button>
== default.js ==
var reloadButton = document.getElementById("reloadButton");
reloadButton.addEventListener("click", reload, false);
function reload() {
var iframe = document.getElementById("iframe");
iframe.contentWindow.location.reload();
}
感谢任何帮助。
谢谢,
【问题讨论】:
标签: javascript windows-8 microsoft-metro