摘要: 1 /**************************** 2 * 有这样一个URL:http://item.taobao.com/item.htm?a=1&b=2&c=&d=xxx&e, 3 * 请写一段JS程序提取URL中的各个GET参数(参数名和参数个数不确定), 4 * 将其按key-v 阅读全文
posted @ 2016-02-20 17:16 赵康 阅读(1300) 评论(0) 推荐(0) 编辑
摘要: 1 function getRandomIntNumber(min, max) { 2 var span = max - min + 1; 3 var result = Math.floor(Math.random() * span + min); 4 return result; 5 } 阅读全文
posted @ 2016-02-20 16:17 赵康 阅读(605) 评论(0) 推荐(0) 编辑
摘要: 1 var str="1 plus 2 equal 3" 2 3 // 正则表达式 4 console.log(str.match(/\d+/g)); // ["1", "2", "3"] 5 console.log(str.match(/\d+/)); // ["1", index: 0, inp 阅读全文
posted @ 2016-02-20 15:25 赵康 阅读(468) 评论(0) 推荐(0) 编辑