【问题标题】:page is not loading inside the iframe in IE11页面未在 IE11 的 iframe 内加载
【发布时间】:2014-03-08 20:18:02
【问题描述】:

我有以下代码。我想在 iframe 中加载页面。但它仅将加载程序显示到 iframe 中。我只有在 IE 11 中才有这个问题。在所有浏览器中都可以正常工作。

<iframe src="https://docs.google.com/viewer?url=http://localhost/test_energy/img/Sample.pdf&embedded=true" width="570" height="300" style="border: none;">
</iframe>

【问题讨论】:

    标签: php jquery html


    【解决方案1】:

    尝试:

    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE11"/> 
    

    【讨论】:

    • 问题是关于在 iFrame 中使用它。你的“解决方案”是做什么的?也许一些解释会很好。
    • 此解决方案告诉浏览器使用 IE11 Emulate 文档兼容性模式进行解释,这有助于软件确定要使用哪些功能,例如 iFrame 使用 - 根据下一个答案,这些选项很详细:@987654321 @
    【解决方案2】:

    首先尝试删除分号“;”从你的初始代码

    <iframe src="https://docs.google.com/viewer?url=http://localhost/test_energy/img/Sample.pdf&embedded=true" width="570" height="300" style="border: none;">;<- Remove this
    

    ;

    然后尝试例如应该可以正常工作

    <iframe src="https://docs.google.com/viewer?url=http://tobi.oetiker.ch/lshort/lshort.pdf&embedded=true" width="570" height="300" style="border: none;"></iframe>
    

    【讨论】:

    • @matts 嘿,iframe 后面没有任何分号,实际上角括号没有接受我给的 <。现在我删除了它。
    • 好的,在我的浏览器上注明它以任何方式显示分号(怪异)。试试这个解决方案stackoverflow.com/questions/14559060/…
    • 差点忘了尝试如果它在 Firefox 上运行它很可能在 IE11 上运行,我认为罪魁祸首是你的 IE PDF 插件
    【解决方案3】:

    在 iframe 中添加一个名为 attachEvent 的函数 .. 像这样(在 IFRAME 中的 jQuery 脚本标记之前):

    var isIE11 = !!(navigator.userAgent.match(/Trident/) && !navigator.userAgent.match(/MSIE/));
    
    if (isIE11) {
      if (typeof window.attachEvent == "undefined" || !window.attachEvent) 
      window.attachEvent = window.addEventListener; 
    }
    

    【讨论】:

      猜你喜欢
      • 2014-02-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-03
      • 1970-01-01
      • 2012-08-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多