上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 25 下一页
摘要: var str = 'yinMinFeng'; var result = str.replace(/n/g,"ss"); //注意那个'g'全局 console.log(result); //yissMissFessg 阅读全文
posted @ 2017-02-05 10:04 Coca-code 阅读(128) 评论(0) 推荐(0)
摘要: 学习Js是一条长路,不能仅仅限于网页动效 阅读全文
posted @ 2016-12-02 09:42 Coca-code 阅读(132) 评论(0) 推荐(0)
摘要: <!-- Html代码--> <button type="button" id="count"> 点我</button> <div id="show"></div> /*********************** * Javascript代码 * ***********************/ 阅读全文
posted @ 2016-03-10 21:04 Coca-code 阅读(265) 评论(0) 推荐(0)
摘要: /*================================= @DESC:Exchange two value without third var. @AUTHOR: Not me. @DATE:2016-3-6 15:33 ================================ 阅读全文
posted @ 2016-03-06 15:35 Coca-code 阅读(326) 评论(0) 推荐(0)
摘要: function generateRandomString(len) { var randomString = ""; for (; randomString .length < len; randomString += Math.random().toString(36).substr(2)); 阅读全文
posted @ 2016-03-06 15:23 Coca-code 阅读(223) 评论(0) 推荐(0)
摘要: JS新API标准 地理定位(navigator.geolocation) 在新的API标准中,可以通过navigator.geolocation来获取设备的当前位置,返回一个位置对象,用户可以从这个对象中得到一些经纬度的相关信息。 navigator.geolocation的三个方法: 1. get 阅读全文
posted @ 2016-02-17 10:39 Coca-code 阅读(215) 评论(0) 推荐(0)
摘要: /*"映射的意思,映射为一个新数组,一个经过一定运算的数组"*/ var arr=[1,3,5,6]; var computedArr = arr.map(function(item){ return item*item*item; }); console.log(computedArr); //[ 阅读全文
posted @ 2016-02-06 16:33 Coca-code 阅读(255) 评论(0) 推荐(0)
摘要: Function.prototype.uncurrying = function() { var that = this; return function() { return Function.prototype.call.apply(that, arguments); } }; function 阅读全文
posted @ 2016-02-02 13:46 Coca-code 阅读(144) 评论(0) 推荐(0)
摘要: var currying = function(fn){ var args = []; return function(){ if(arguments.length === 0){ return fn.apply(this,args); }else{ [].push.apply(args,argum 阅读全文
posted @ 2016-02-02 13:17 Coca-code 阅读(222) 评论(0) 推荐(0)
摘要: css:oEl.style.cssText = "border-left:1px solid red";dom:1. document.createDocumentFragment();2. var newDOM = oldDOM.cloneNode(true); oldDOM.parentNod... 阅读全文
posted @ 2016-01-24 12:02 Coca-code 阅读(141) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 25 下一页