摘要: var img = document.createElement('A'); img.src = "/img/weixin.jpg"; // 设置相对路径给Image, 此时会发送出请求 url = img.src; // 此时相对路径已经变成绝对路径 img.src = null; // 取消请求 阅读全文
posted @ 2016-05-03 09:47 shidengyun 阅读(135) 评论(0) 推荐(0) 编辑
摘要: function strMapToObj(strMap) { let obj = Object.create(null); for (let [k,v] of strMap) { obj[k] = v; } return obj;}function objToStrMap(obj) { let st 阅读全文
posted @ 2016-05-03 08:49 shidengyun 阅读(218) 评论(0) 推荐(0) 编辑
摘要: JavaScript实现的发布/订阅(Pub/Sub)模式时间 2016-05-02 18:47:58 GiantMing's blog原文 http://giantming.net/javascriptshi-xian-de-fa-bu-ding-yue-pub-sub-mo-shi/主题 Jav 阅读全文
posted @ 2016-05-03 07:16 shidengyun 阅读(4026) 评论(0) 推荐(2) 编辑
摘要: function convertArray(nodeList){ var arr = [] if(Array.prototype.slice){ arr = [].slice.call(nodeList); }else{ for(var i=0,len = nodeList.length;i<len 阅读全文
posted @ 2016-05-03 07:05 shidengyun 阅读(636) 评论(0) 推荐(0) 编辑