【问题标题】:Why iframe is not loading all webpages in winjs app?为什么 iframe 没有加载 winjs 应用程序中的所有网页?
【发布时间】:2013-07-08 09:56:33
【问题描述】:

大家好,

我拿了一个空白的 WinJS Store 应用程序并将下面的代码放在 default.html 文件中

<iframe src="http://www.google.com" height="400" width="400"></iframe>

但是 iframe 没有加载谷歌主页。该页面为空白。而如果我将 src 值替换为“http://www.palermo4.com”,它工作正常。为什么会出现这种奇怪的行为。我们是否需要为某些 url 获取任何其他权限类型的东西?请帮帮我。

提前致谢

【问题讨论】:

标签: iframe winjs


【解决方案1】:
You can't load ooogle in iframe,since they are blocking this facility.
You can use Iframe for some other sites,but you won't get full controll of their JS[Loading sites] ,may have to face some breaking point in such sites.

如果你真的想加载谷歌试试这个。

1. Make your default browser as IE10.
2. trigger an event.

function openYourLink(){    
var url = new Windows.Foundation.Uri("http://www.google.com")
Windows.System.Launcher.launchUriAsync(url);
}

【讨论】:

    【解决方案2】:

    在 Windows 8.1 中,您还可以使用 webview 控件,该控件对 Google 等网站使用的帧破坏代码不敏感。

    【讨论】:

      猜你喜欢
      • 2020-02-19
      • 2014-04-03
      • 2017-05-29
      • 2020-10-11
      • 1970-01-01
      • 2017-12-19
      • 2016-08-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多