首页 > 其他 > 详细

IE下 iframe子页面document.documentElement报错问题(未指明的错误。)

时间:2015-08-11 16:28:11      阅读:177      评论:0      收藏:0      [点我收藏+]

测试环境:IE8  jquery1.11.1


问题描述:

如果使用了<iframe>,并且在iframe页面中用到了jquery,那么在加载iframe页面时会报错.(未指明的错误)

经过排查,错误来自红色部分

"focus": function( elem ) {
    return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
},


解决办法:

在<head>中加入<script>document.documentElement.focus();</script>

详见:http://stackoverflow.com/questions/14378224/document-activeelement-in-iframe-shows-unspecified-error-in-ie-standards-mode


IE下 iframe子页面document.documentElement报错问题(未指明的错误。)

原文:http://my.oschina.net/xzfx/blog/490704

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!