Skip to content

Commit

Permalink
增加兼容性代码,兼容部分国产浏览器
Browse files Browse the repository at this point in the history
  • Loading branch information
pea3nut committed Oct 13, 2016
1 parent 1797837 commit 8a18edb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/script/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,13 @@ EventTarget.prototype['addOneEventListener'] =function(type,listener,useCapture)
});


// 兼容性代码
if(NodeList.prototype[Symbol.iterator] ===undefined){
NodeList.prototype[Symbol.iterator] =function*(){
for(let i=0 ;i<this.length ;i++){
yield this[i];
};
};
};


0 comments on commit 8a18edb

Please sign in to comment.