2011-06-21 58 views
21

的uiquery插件bgiframe(2.1.1版本)會導致在Internet Explorer 9中的以下Java腳本錯誤:bgiframe插件會導致錯誤在IE9

jquery.bgiframe.js, line 94 character 5 

我的菜單不工作了,我希望原因是這個錯誤。

任何想法?

增加:

在jquery.bgiframe.js該生產線是:

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

和錯誤的SAI:

SCRIPT5022: DOM Exception: INVALID_CHARACTER_ERR (5) 
+0

這是什麼?您可以使用IE開發人員工具來獲取此信息。 –

回答

12

在插件代碼bgiframe版本2.1.1正在做一個「6.0」的正則表達式搜索,但它需要搜索「MSIE 6.0」。 Tillito找到了正確的來源。

在bgiframe代碼查找:

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

更改爲:

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

或者只是來到這裏來源:https://github.com/brandonaaron/bgiframe/blob/master/jquery.bgiframe.js

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

下方添加標籤頭後標籤

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