We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在做项目的时候发现ie8不兼容Array.prototype.forEach方法,找到了两个解决方案,jquery.each和es5-shim
$.each(array, function(key, value){ // array[key] === value; });
第二种解决方案是检测是否有这个方法,如果没有,自定义它,es5-shim帮我们做好了这个事情。
bower install es5-shim --save
<script src="./es5-shim.js"></script> <script src="./es5-sham.js"></script> // load your script
参考资料: http://stackoverflow.com/questions/412447/for-each-javascript-support-in-ie
The text was updated successfully, but these errors were encountered:
es5-shim 和 es5-sham 有什么区别 必须要一起用么?
Sorry, something went wrong.
No branches or pull requests
起因
在做项目的时候发现ie8不兼容Array.prototype.forEach方法,找到了两个解决方案,jquery.each和es5-shim
解决方案
1. jquery.each
2. es5-shim
第二种解决方案是检测是否有这个方法,如果没有,自定义它,es5-shim帮我们做好了这个事情。
安装
bower install es5-shim --save
使用
参考资料:
http://stackoverflow.com/questions/412447/for-each-javascript-support-in-ie
The text was updated successfully, but these errors were encountered: