摘要:
function timestampToTime(timestamp) { var date = new Date(timestamp * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000 var Y = date.getFullYear() + '-'; var M = 阅读全文
摘要:
//随机数 var num = Math.ceil(Math.random() * 3) console.log(num); //随机数组 var a = ['1','2','3','4','5']; console.log(a[parseInt(Math.random() * a.length)] 阅读全文
摘要:
function getUrlParam(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象 var r = window.location.search.substr(1).mat 阅读全文