utils.js

阅读更多
/**
 * 获取指定查询字
 */
function getQueryString(name) {
    var reg = new RegExp('(^|&)'+ name +'=([^&]*)(&|$)');
        r = window.location.search.substr(1).match(reg);
    if(r!=null)
        return  decodeURI(r[2]); 
    return null;
}

function fen2yuan(fen){
   return Number.parseFloat(Number(fen)/100).toFixed(2);
}

/// 获取值小于max,长度为num的的随机数集合
function getRandoms(max, num){ 
   var set = new Set();
   while(set.size\\s*\\[{2}(.+?)\\]{2}','g')
      let regex2=new RegExp('+','g')
      var newHtml = html;
      window.html = html;
      while ((group= regex.exec(html)) !== null) {
        if(group[1].trim().length) {
          console.log(group[0])
          let str = group[0].replace(regex2, ''+group[1].replace(regex3,'')+' 

你可能感兴趣的:(utils.js)