关于 ie8不兼容的一些方法
ie8 不兼容的方法
$(function(){//添加数组IndexOf方法if (!Array.prototype.indexOf){Array.prototype.indexOf = function(elt /*, from*/){var len = this.length >>> 0;var from = Number(arguments[1]) || 0;from = (from < 0)? Math.ceil(from): Math.floor(from);if (from < 0)from += len;for (; from < len; from++){if (from in this && this[from] === elt)return from;}return -1;};}//getOwnPropertyNames keys 方法if(!Object.getOwnPropertyNames || !Object.keys){Object.keys = Object.getOwnPropertyNames = function(temp){var A = [];for(var key in temp){A.push(key);}return A;}}//forEach 方法if ( !Array.prototype.forEach ) { Array.prototype.forEach = function forEach( callback, thisArg ) { var T, k; if ( this == null ) { throw new TypeError( "this is null or not defined" ); } var O = Object(this); var len = O.length >>> 0; if ( typeof callback !== "function" ) { throw new TypeError( callback + " is not a function" ); } if ( arguments.length > 1 ) { T = thisArg; } k = 0; while( k < len ) { var kValue; if ( k in O ) { kValue = O[ k ]; callback.call( T, kValue, k, O ); } k++; } }; } //filter 方法if (!Array.prototype.filter){Array.prototype.filter = function(fun /*, thisArg */){"use strict";if (this === void 0 || this === null)throw new TypeError();var t = Object(this);var len = t.length >>> 0;if (typeof fun !== "function")throw new TypeError();var res = [];var thisArg = arguments.length >= 2 ? arguments[1] : void 0;for (var i = 0; i < len; i++){if (i in t){var val = t[i];// NOTE: Technically this should Object.defineProperty at// the next index, as push can be affected by// properties on Object.prototype and Array.prototype.// But that method's new, and collisions should be// rare, so use the more-compatible alternative.if (fun.call(thisArg, val, i, t))res.push(val);}}return res;};} })
转载于:https://www.cnblogs.com/xianhuiwang/p/7943263.html
关于 ie8不兼容的一些方法相关推荐
- 完美解决ie8以下不兼容h5的方法
完美解决ie8以下不兼容h5的方法 参考文章: (1)完美解决ie8以下不兼容h5的方法 (2)https://www.cnblogs.com/susanws/p/5412002.html 备忘一下.
- 完美解决IE(IE6/IE7/IE8)不兼容HTML5标签的方法
完美解决IE(IE6/IE7/IE8)不兼容HTML5标签的方法 参考文章: (1)完美解决IE(IE6/IE7/IE8)不兼容HTML5标签的方法 (2)https://www.cnblogs.co ...
- IE8常见兼容问题及解决方法总结
IE8常见兼容问题及解决方法总结 参考文章: (1)IE8常见兼容问题及解决方法总结 (2)https://www.cnblogs.com/toggle/p/10184181.html (3)http ...
- IE8兼容的js方法
// 数组indexOf方法 if (!Array.prototype.indexOf) {Array.prototype.indexOf = function (elt /*, from*/) {v ...
- css borderradius ie8,border-radius IE8兼容处理的方法
测试代码: * { margin: 0; padding: 0; } #header { width: 400px; height: 400px; margin: 10px; border-radiu ...
- 让你的网站在IE8的兼容模式下运行
众所周知,微软的Internet Explorer团队一直在致力于将IE8打造为最符合业内标准的浏览器,所不幸的是,当前并非所有的网站都认同这些标准.如果你担心你的网站在IE8的标准模式下不能正常工作 ...
- 让IE兼容background-size的方法_background-size ie下使用
ie6,ie7,ie8下对css background-size并不支持,那么如何在ie下兼容background-size呢? 在ie下把图片完整的居中显示在一定范围内 在css中添加如下代码: f ...
- DIV CSS IE6/IE7/IE8/FF兼容问题汇总
1.IE8下兼容问题,这个最好处理,转化成ie7兼容就可以.在头部加如下一段代码,然后只要在IE7下兼容了,IE8下面也就兼容了 <meta http-equiv="x-ua-comp ...
- IE6/IE7/IE8/FF兼容问题汇总,以及解决方案
1.IE8下兼容问题,这个最好处理,转化成ie7兼容就可以.在头部加如下一段代码,然后只要在IE7下兼容了,IE8下面也就兼容了 <meta http-equiv="x-ua-comp ...
最新文章
- 2019 年 C++ 的发展
- python安装之后怎么打开-安装python后如何通过Python打开网页
- SAP WebClient UI删除搜索条件的后台处理,以及max hit的处理逻辑
- 我的内核学习笔记10:Intel GPIO驱动源码分析
- 又一百度杰出科学家离职,百度研究院成中国AI的黄埔军校?
- jquer添加和插入元素技巧:
- postman9.12汉化
- 怎么使用计算机扩展,如何导入扩展到慧编程PC并进行使用
- ChromeOS+Win双系统安装教程
- mysql护眼参数,VS2013设置护眼背景颜色
- c语言 常量表达式,常量表达式(什么叫常量表达式)
- Java 总结4 数据流 文件处理
- 世界上最健康的作息时间表健康十不易
- 有道云笔记markdown字体增大、生成目录
- jenkins自动打包报错:cannot find symbol
- 如何查看 /dev/sda 下的文件
- FilterChain 过滤器链和拦截路径
- Ubuntu下使用gcc和makefile编写c语言程序
- AcWing 1293. 夏洛克和他的女朋友 二分图
- 辛巴学院-Unity-剑英的c#提高篇(一)主循环