浏览器兼容问题汇总

来源:互联网 发布:unity3d计算机图形学 编辑:程序博客网 时间:2024/05/18 20:12

/*使IE下支持foreah   解决IE报:'anchoring failed 对象不支持“forEach”属性或方法'*/

if (!Array.prototype..forEach) {Array.prototype..forEach = function(fun) {var len = this.length;if (typeof fun != "function")throw new TypeError();var thisp = arguments[1];for (var i = 0; i < len; i++) {if (i in this)fun.call(thisp, this[i], i, this);}};}


原创粉丝点击