【问题标题】:Unexpected call to method or property access on IE8 in jQuery在 jQuery 中对 IE8 上的方法或属性访问的意外调用
【发布时间】:2012-07-25 22:36:01
【问题描述】:

我的网站出现错误:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)
Timestamp: Fri, 27 Jul 2012 08:54:50 UTC


Message: Unexpected call to method or property access.
Line: 5855
Char: 5
Code: 0
URI: http://garmonia-znakomstva.ru/js/jquery-1.7.2.js

这个 jQuery 与 IE8 不兼容还是我的一些错误?

打开http://garmonia-znakomstva.ru/时出错

代码

这是 jQuery 代码片段:

prepend: function() {
    return this.domManip(arguments, true, function( elem ) {
        if ( this.nodeType === 1 ) {
5855:           this.insertBefore( elem, this.firstChild );
        }
    });
},

【问题讨论】:

  • 始终包含相关代码和标记在问题本身,不要只是链接。链接可能会腐烂(和通常那样的链接),人们不应该为了帮助你而必须跟随随机网站的链接。更多:meta.stackexchange.com/questions/118392/…
  • "这个jQuery是不是和IE8不兼容...?"当然不是。
  • 我想你可能会在这里找到答案:stackoverflow.com/questions/2275702/jquery-first-child-of-this
  • 嗯,错误指向.prepend,但没有自定义代码调用.prepend
  • 到目前为止,我已经在 jQuery UI 手风琴代码中将它钉在了prependTo(this.headers)...所以它被错误地使用或者只是一个错误的插件

标签: javascript jquery html internet-explorer-8


【解决方案1】:

当 jquery 遇到 div#accordion 内的<script> 标记时发生错误。 尝试将标签<script>移出

【讨论】:

  • 我刚刚google了一下,也发现了这个,我还没有注意到脚本标签,但我注意到有多个元素具有相同的ID。可能也应该提到这一点,+1
  • +1。 IE 7/8 在手风琴中每个选项卡的

    +
    结构之外的任何代码中都会出现摇晃。这两个之外的任何标签都会破坏手风琴。

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-12-15
相关资源
最近更新 更多