Hello Guys,
Object.keys is depreciated and it does not support in some of the browsers like IE, FF 3.x. So we have to add the javascript object.keys method to overcome this problem.
Object.keys = function(obj) {
if (typeof obj != "object" && typeof obj != "function" || obj == null) {
throw TypeError("Object.keys called on non-object");
}
var keys = [];
for (var p in obj) obj.hasOwnProperty(p) && keys.push(p);
return keys;
}
Now see we resolve the javascript error 'Undefined method Object.keys'.
No comments:
Post a Comment