如何为InternetExplorer浏览器修复JavaScript中的Array indexOf
Array.prototype.indexOf = function(obj, start) {
for (var i = (start || 0), j = this.length; i < j; i++) {
if (this[i] === obj) { return i; }
}
return -1;}if (!Array.prototype.indexOf) {
// Implement function here}//Pseudo-codeif (browser == IE Style Browser) {
// Implement function here}
尚方宝剑之说
largeQ
梦里花落0921
繁星淼淼
随时随地看视频慕课网APP
相关分类