bgiframe plugin causes error in IE9

对着背影说爱祢 提交于 2019-12-31 18:42:06

问题


The uiquery plugin bgiframe (version 2.1.1) causes the following java script error in Internet Explorer 9:

jquery.bgiframe.js, line 94 character 5

My menu does not work any more, I hope the reason is this error.

Any ideas?

ADDED:

The line in jquery.bgiframe.js is:

this.insertBefore( document.createElement(html), this.firstChild );

and the error sais:

SCRIPT5022: DOM Exception: INVALID_CHARACTER_ERR (5) 

回答1:


After some more research I found a solution myself on the bgiframe site:

I downloaded version 2.1.3-pre at

https://github.com/brandonaaron/bgiframe/blob/master/jquery.bgiframe.js

and this solved the problem.




回答2:


In the plugin code for bgiframe version 2.1.1 was doing a regex search for "6.0" but it needs to search for "MSIE 6.0". Tillito has found the correct source.

In the bgiframe code look for:

if($.browser.msie&&/6.0/.test(navigator.userAgent)

Change to:

if($.browser.msie && /msie 6\.0/i.test(navigator.userAgent)

OR just get the source here: https://github.com/brandonaaron/bgiframe/blob/master/jquery.bgiframe.js




回答3:


var parent = document.createElement("div");
parent.innerHTML = html;
this.insertBefore( parent, this.firstChild );



回答4:


Add below tag after head tag

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


来源:https://stackoverflow.com/questions/6424526/bgiframe-plugin-causes-error-in-ie9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!