2015年11月15日

摘要: var n = 10; var arr = []; function change( n ){ return (function(){ arr.unshift( n ); n--; if(n !=0 ){ arguments.callee(); ... 阅读全文

posted @ 2015-11-15 20:23 斯是陋室,惟吾德馨 阅读(125) 评论(0) 推荐(0) 编辑

摘要: function test(str){ var arr = str.split(''); arr.sort(); str = arr.join(''); var re = /(\w)\1+/g;//\S 匹配所有非空白,而 \w 只匹配单词字符,等价于 [a-zA-Z0-9_] 共63个字符(字母数字下划线) var num = 0; var... 阅读全文

posted @ 2015-11-15 20:16 斯是陋室,惟吾德馨 阅读(320) 评论(0) 推荐(0) 编辑

摘要: var str = 'safsafsagadsfshjsadfhsajdhgsaaaaaaaaaaaafsafasdvgdasfsajkodhsaodsagdusiagdusaidhsajdhsajdhsajdhsaohdiusahduisahdusadhudhufsaaaaaagfdghdfhdfhdfhdfgjgfjfgjfddfhfghhdfhdfhdfhdsfgfdghdfhdghf... 阅读全文

posted @ 2015-11-15 19:57 斯是陋室,惟吾德馨 阅读(246) 评论(0) 推荐(0) 编辑

摘要: var str2 = 'border-bottom-color'; function test(str2){ var re = /(-)(\w)/g; return str2.replace(re, function($0, $1,$2){ // console.log($0 + ':' + $2) return $2.toUpperCase... 阅读全文

posted @ 2015-11-15 19:06 斯是陋室,惟吾德馨 阅读(503) 评论(0) 推荐(0) 编辑

摘要: 阅读全文

posted @ 2015-11-15 18:41 斯是陋室,惟吾德馨 阅读(174) 评论(0) 推荐(0) 编辑

2015年11月14日

摘要: window.onload = function() { var oWrap = document.getElementById('wrap'), oList1 = document.getElementById('list1'), oList2 = document.getElementById('list2'), aLi = oLi... 阅读全文

posted @ 2015-11-14 17:31 斯是陋室,惟吾德馨 阅读(140) 评论(0) 推荐(0) 编辑

摘要: var arr= []; var obj = { name : 'a', age : 20, sex = 'male' }; for(a[a.length] in obj); console.log(a); 阅读全文

posted @ 2015-11-14 17:26 斯是陋室,惟吾德馨 阅读(191) 评论(0) 推荐(0) 编辑

摘要: 对于一个数组,怎样才能最快找出数组中的最大值 var nums = [1,56,78,345,67,89,3423,34,5,7]; var max = 0; for(var i=0; i max){ max = nums[i]; } } console.log( "第一种排序方式:", max ); console.log('第二种排序方式:',Math.ma... 阅读全文

posted @ 2015-11-14 17:22 斯是陋室,惟吾德馨 阅读(592) 评论(0) 推荐(0) 编辑

2015年11月12日

摘要: function fnShow() { var date = new Date(); var time = date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds(); ... 阅读全文

posted @ 2015-11-12 17:07 斯是陋室,惟吾德馨 阅读(166) 评论(0) 推荐(0) 编辑

2015年11月10日

摘要: HTML代码的话就是cssbody,ul,li{margin: 0;padding: 0;font-family: "黑体";background: #eee;} li{list-style: none;} #ul1{margin: 20px auto;border-top: 1px soli... 阅读全文

posted @ 2015-11-10 19:29 斯是陋室,惟吾德馨 阅读(897) 评论(0) 推荐(0) 编辑