1.js 314 B

123456789
  1. function GetString(key) {
  2. // 获取地址栏的参数
  3. var url = window.location.search;
  4. //正则表达式筛选
  5. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  6. //匹配参数
  7. var result = url.substr(1).match(reg);
  8. return result ? decodeURLComponent(result[2]) : null;
  9. }