【问题标题】:Firefox/jQuery bug using Twitter Bootstrap popover使用 Twitter Bootstrap 弹出框的 Firefox/jQuery 错误
【发布时间】:2013-06-27 16:32:40
【问题描述】:

当我调用 Twitter Bootstrap popover 时,我在使用 Firefox 而不是 webkit 浏览器时收到此错误。

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 );

【问题讨论】:

    标签: javascript jquery firefox twitter-bootstrap getcomputedstyle


    【解决方案1】:

    我回答了我自己的问题。问题是我的弹出框内容以评论结尾。所以这不起作用:

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

    而这样做:

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

    【讨论】:

      猜你喜欢
      • 2013-10-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-22
      • 2012-10-23
      • 2012-01-16
      相关资源
      最近更新 更多