Tag: printthis

jquery – IE浏览器在某些页面上拒绝iframe访问

我是printThis的作者,这是一个用于打印的jquery插件。 https://github.com/jasonday/printThis 我有一个用户提出了一个问题,我一直无法破解,不幸的是,我无法分享页面(隐私问题)。 在用户的网站上,问题出现在IE中的某些页面上,而不是其他页面上。 打印失败,因为iframe仍然是空的。 IE中的错误在jQuery中: contents: function (a) { return f.nodeName(a, “iframe”) ? a.contentDocument || a.contentWindow.document : f.makeArray(a.childNodes) } 使用日志记录,我能够确定它在这条线路上失败了: var $doc = $(“#” + strFrameName).contents(); 但同样,这只发生在某些页面上,而且我无法在该用户网站之外的任何实例中重新创建。 我的问题:这里有更好的方法吗? 或者使$doc对象更具防弹性的方法? // ———————————————————————– // printThis v1.1 // Printing plug-in for jQuery // // Resources (based on) : // jPrintArea: http://plugins.jquery.com/project/jPrintArea // jqPrint: https://github.com/permanenttourist/jquery.jqprint // Ben Nadal: […]