繁体   English   中英

如何在Windows 8商店HTML5 / javascript应用程序中使用javascript保存iframe的内容?

[英]How to save content of the iframe using javascript in Windows 8 store HTML5/javascript app?

我有一个iframe控件,其源指向我的代码中定义的页面。 现在,如何在Windows 8应用商店中使用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;
    }

这是由于WWA中的安全性更改。 您需要将目标URL添加为清单中的有效目标。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM