0

我在調用Twitter Bootstrap popover時遇到了使用Firefox但未使用webkit瀏覽器的錯誤。使用Twitter Bootstrap彈出窗口的Firefox/jQuery錯誤

NS_ERROR_XPC_BAD_CONVERT_JS: Could not convert JavaScript argument arg 0 [nsIDOMWindow.getComputedStyle] @ http://localhost/assets/thirdParty/jquery/jquery-1.8.3.js:6825 

該錯誤是上的jquery.js的6825行:

var computed = window.getComputedStyle(elem, null); 

This post seems to address this question但是當我試圖實現一個沒有任何影響他們的解決方案(如下所示)。該帖子是4歲,所以jQuery的版本是不同的,我想可以解釋爲什麼這個解決方案不再有效。

if (elem == document) elem = document.body; 
var computed = window.getComputedStyle(elem, null); 

回答

0

我回答了我自己的問題。問題是我的popover內容以評論結束。所以這沒有奏效:

<div class="popover"> 
    some content 
</div><!--popover--> 

,而這確實:

<div class="popover"> 
    some content 
</div> 
相關問題