摘要: (function () { // 兼容的事件助手 window.CompatibleEventHelper = { addEventListener: function (elem, type, cb) { if (elem.addEventListener) { elem.addEventLis 阅读全文
posted @ 2018-05-08 21:41 AndreMao 阅读(148) 评论(0) 推荐(0) 编辑
摘要: String.prototype.replaceAll = function (targetStr, newStr) { var sourceStr = this.valueOf(); while (sourceStr.indexOf(targetStr) !== -1) { sourceStr = 阅读全文
posted @ 2018-05-08 15:59 AndreMao 阅读(1206) 评论(4) 推荐(0) 编辑
摘要: var btns = document.querySelectorAll(".btn");console.log(btns instanceof Array); // falsebtns = Array.prototype.slice.call(btns, 0);console.log(btns i 阅读全文
posted @ 2018-05-08 15:40 AndreMao 阅读(607) 评论(0) 推荐(0) 编辑