0
我有一个iframe控件,其源指向我的代码中定义的页面。现在如何在Windows 8商店应用程序中使用javascript保存iframe的内容?我尝试了下面的代码,但它永远不会去任何下面的条件。如何在Windows 8存储HTML5/javascript应用程序中使用JavaScript保存iframe的内容?
var ifrm = document.createElement("IFRAME");
ifrm.setAttribute("src", "http://www.w3schools.com/");
if (ifrm.contentDocument) {
// Firefox, Opera
doc = ifrm.contentDocument;
}
else if (ifrm.contentWindow) {
// Internet Explorer
doc = ifrm.contentWindow.document;
}
else if (ifrm.document) {
// Others?
doc = ifrm.document;
}
我可以以编程方式将目标URL添加为清单中的有效目标吗?因为此网址不是我在我的应用中使用的唯一网址。 – krrishna
不是。您需要查看iframe安全性的沙箱属性 - 这些允许在此区域内具有一定的灵活性。 –