【问题标题】:UI-Grid : Error "Multiple definitions of a property not allowed in strict mode [object Object]" [ IE- Only ]UI-Grid:错误“严格模式下不允许属性的多个定义 [object Object]”[仅限 IE]
【发布时间】:2016-02-19 05:31:23
【问题描述】:

在 IE 中加载 Ui-Grid 时抛出错误消息 -

[true]  [SYSERR] Multiple definitions of a property not allowed in strict mode [object Object]

问题仅出现在 IE 中,不会在 FireFox 和 Chrome 中引发任何错误。在 IE 版本 11 上测试。

提前致谢。

【问题讨论】:

  • 为什么这只发生在 Internet Explorer 上?

标签: angularjs angular-ui-grid


【解决方案1】:

作为错误状态,您正在某处使用具有多个同名属性的对象。 类似的东西:

var obj= {
    property1: 0,
    property2: 1,
    property1: 2
};

打印上面的对象会导致:

{ property1: 2, property2: 1 }

另外搜索一下stackoverflow,可以找到更详细的答案,为什么在Internet Explorer中会输出这个错误

What's the purpose of allowing duplicate property names?

【讨论】:

    【解决方案2】:

    当你有别人写的长代码时,很难手动找到多个定义。

    我使用了http://jshint.com/ 并在那里粘贴了代码,它向我显示了所有重复的警告,我修复了这些问题,一切正常。

    【讨论】:

    • 这里非常不鼓励仅链接的答案,因为这些链接将来可能会失效。我建议您使用您引用的来源中的引用来编辑您的答案。
    • @AnirudhSharma 我知道链接可能会失效我的答案只是一个建议,当我遇到这个问题时,我是如何解决这个问题的,可能会帮助其他人,他们可以使用其他一些工具,也只是在这里给他们一个想法。
    • 感谢您的提示救了我 - 很难找到双重定义。绝对值得在这里发布!
    猜你喜欢
    • 1970-01-01
    • 2019-01-01
    • 1970-01-01
    • 2017-11-15
    • 2015-02-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多