isBlankObject / isEmptyObject AngularJS

时间:2015-12-08 06:54:02

标签: javascript jquery angularjs internet-explorer-11

我想让AngularJS与IE11一起工作。 Foreach函数似乎存在错误。在其中我一直得到Object Expected Error。继承人的代码

console.log("obj: " + obj);
console.log(typeof(obj));
console.log("isFunction(obj): " +isFunction(obj));
console.log("Object.prototype.toString.call(obj) === '[object Array]' ");
console.log( Object.prototype.toString.call(obj) === '[object Array]' );
// console.log(  Array.isArrayLike(obj));
console.log("obj.forEach and obj.forEach !== forEach: " );
console.log(  obj.forEach && obj.forEach !== forEach);
console.log("isEmptyObject(obj): " );
console.log(  isEmptyObject(obj));
console.log("typeof Object.prototype.hasOwnProperty === 'function': " );
console.log(  typeof Object.prototype.hasOwnProperty === 'function');

,输出结果为:

obj: multiple,selected,checked,disabled,readOnly,required,open
object
isFunction(obj): false
Object.prototype.toString.call(obj) === '[object Array]' 
true
obj.forEach and obj.forEach !== forEach: 
undefined
isEmptyObject(obj): 
---- JS Exception from: IE test staging ----
Error: Object expected
Source: Microsoft JScript runtime error
Location: resources
Line: 131

typeof(obj)返回object。那么为什么我仍然得到这个错误? 请帮忙。我在这里绝望。

0 个答案:

没有答案