获取地址栏传值

function getUrlParams (paramName) {
  var reg = new RegExp("[\?&]" + paramName + "=([^&]*)[&]?", "i");
  var paramVal = window.location.search.match(reg);
  return paramVal == null ? "" : decodeURIComponent(paramVal[1]);
}

posted @ 2019-01-08 14:12  Mr_R  阅读(209)  评论(0编辑  收藏  举报