1.解决,ie8不兼容Object.keys(array); jsp页面加入以下代码 -----来源:http://blog.sina.com.cn/s/blog_6d63cf160102vbsg.html
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){//ecma262v5 15.2.3.14
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;
};
function extend(dst) {
var h = dst.$$hashKey;
for (var i = 1, ii = arguments.length; i < ii; i++) {
var obj = arguments[i];
if (obj) {
var keys = Object.keys(obj);
for (var j = 0, jj = keys.length; j < jj; j++) {
var key = keys[j];
dst[key] = obj[key];
}
}
}
setHashKey(dst, h);
return dst;
}
2.解决,ie8不兼容 数组的filter()方法,加入以下demo----------------------------来源:http://www.cnblogs.com/guangyan/p/6684093.html
http://blog.csdn.net/shya_/article/details/62887840?fps=1&locationNum=9//indexOf,map,兼容问题
Array.prototype.filter = Array.prototype.filter || function(func) {
var arr = this;
var r = [];
for (var i = 0; i < arr.length; i++) {
if (func(arr[i],i,arr)) {
r.push(arr[i]);
}
}
return r;
}
3.