ie8下报错( 不支持Object.keys() ),添加一段代码即可解决
var DONT_ENUM = "propertyIsEnumerable,isPrototypeOf,hasOwnProperty,toLocaleString,toString,valueOf,constructor".split(","), hasOwn = ({}).hasOwnProperty; for (var i in { toString: 1 }) { DONT_ENUM = false; } Object.keys = Object.keys || function(obj) { var result = []; for (var key in obj) if (hasOwn.call(obj, key)) { result.push(key); } if (DONT_ENUM && obj) { for (var i = 0; key = DONT_ENUM[i++];) { if (hasOwn.call(obj, key)) { result.push(key); } } } return result; };回复