UI-Grid:错误“严格模式下不允许的属性的多个定义[object Object]”[IE- Only]

时间:2022-08-24 11:17:27

While loading Ui-Grid In IE throwing error messages -

在加载Ui-Grid In IE时抛出错误信息 -

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

UI-Grid:错误“严格模式下不允许的属性的多个定义[object Object]”[IE- Only] Issue is only in IE, Not throwing any errors in FireFox & Chrome. Tested on IE Version-11.

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

Thanks in Advance.

提前致谢。

2 个解决方案

#1


7  

As the error state, you are using somewhere an object that has more than one property with the same name . Something like :

作为错误状态,您正在使用具有多个具有相同名称的属性的对象。就像是 :

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

Printing the upper object results in :

打印上层对象会导致:

{ property1: 2, property2: 1 }

Also searching a little bit on stack overflow, you can find a more detailed answer why this error is outputed in Internet Explorer

另外搜索堆栈溢出,您可以找到更详细的答案,为什么在Internet Explorer中输出此错误

What's the purpose of allowing duplicate property names?

允许重复属性名称的目的是什么?

#2


5  

Its difficult to find multiple definition manually when you have long code written by someone else.

当您有其他人编写的长代码时,很难手动找到多个定义。

I used http://jshint.com/ and pasted code there, it showed me all duplicate warnings and I fixed those everything worked.

我使用了http://jshint.com/并在那里粘贴了代码,它向我显示了所有重复的警告,并修复了所有工作。

#1


7  

As the error state, you are using somewhere an object that has more than one property with the same name . Something like :

作为错误状态,您正在使用具有多个具有相同名称的属性的对象。就像是 :

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

Printing the upper object results in :

打印上层对象会导致:

{ property1: 2, property2: 1 }

Also searching a little bit on stack overflow, you can find a more detailed answer why this error is outputed in Internet Explorer

另外搜索堆栈溢出,您可以找到更详细的答案,为什么在Internet Explorer中输出此错误

What's the purpose of allowing duplicate property names?

允许重复属性名称的目的是什么?

#2


5  

Its difficult to find multiple definition manually when you have long code written by someone else.

当您有其他人编写的长代码时,很难手动找到多个定义。

I used http://jshint.com/ and pasted code there, it showed me all duplicate warnings and I fixed those everything worked.

我使用了http://jshint.com/并在那里粘贴了代码,它向我显示了所有重复的警告,并修复了所有工作。