function parseQueryString = () => {
      let url = location.href;
      let reg_url = /^[^\?]+\?([\w\W]+)$/,
        reg_para = /([^&=]+)=([\w\W]*?)(&|$|#)/g,
        arr_url = reg_url.exec(url),
        ret = {};
      if (arr_url && arr_url[1]) {
        let str_para = arr_url[1],
          result;
        while ((result = reg_para.exec(str_para)) != null) {
          ret[result[1]] = result[2];
        }
      }
      return ret;
    };

  

参考地址:https://www.jb51.net/article/71545.htm

posted on 2021-05-21 11:42  阿梅M  阅读(377)  评论(0编辑  收藏  举报