【问题标题】:jQuery v1.8.3 creating error in ie 8 and ie 7 "Unexpected call to method or property access."jQuery v1.8.3 在 ie 8 和 ie 7 中创建错误“意外调用方法或属性访问”。
【发布时间】:2013-04-25 07:44:20
【问题描述】:

在 ie8 中,由于 jquery v1.8.3 中的这一行,我在弹出窗口中遇到了问题

this.insertBefore( elem, this.firstChild );

这里是函数

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

这是错误截图。

提前感谢

【问题讨论】:

  • elemthis.firstChild 是什么 HTML 元素?
  • 即使我不知道 .its 仅在 jquery libery 中
  • 发生异常时,查看本地选项卡。您应该能够找到 elemthis 的 tagName 属性
  • 但我无法在 jquery libeary 中进行更改,因此需要相应的解决方案

标签: javascript jquery script-debugging


【解决方案1】:

IE8 无法插入它无法识别的 html 元素。 可能是存在无效标记,或者它试图将节点插入 HTML 5 标记。

如果是 HTML 5 标签,您可以使用诸如modernizr 或html5shim 之类的脚本在IE 中创建HTML 5 标签。

【讨论】:

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