/**
 * 获取url中得参数
 * @param name
 * @returns {null}
 */
window.getQueryString = function (name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]);
    return null;
}

example: getQueryString(id);//可以获得id传递的参数;

    

  

相关文章:

  • 2021-06-14
  • 2021-10-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-09
  • 2022-12-23
  • 2022-01-30
  • 2022-01-05
  • 2021-08-20
相关资源
相似解决方案