if (!Object.keys) {
Object.keys = function(o) {
if (o !== Object(o)) {
throw new TypeError('Object.keys called on a non-object');
}
var k=[], p;
for (p in o) {
if (Object.prototype.hasOwnProperty.call(o,p)) {
k.push(p);
}
}
return k;
};
}
if (typeof Array.prototype.forEach != "function") {
Array.prototype.forEach = function (fn, scope) {
var i, len;
for (i = 0, len = this.length; i < len; ++i) {
if (i in this) {
fn.call(scope, this[i], i, this);
}
}
};
}
copy了ieBetter.js的部分代码解决了此问题
https://github.com/zhangxinxu/ieBetter.js/blob/master/ieBetter.js
https://github.com/zhangxinxu/ieBetter.js