js获取地址栏参数

js获取地址栏参数

js获取地址栏参数:

getParam(name) {
      return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ""])[1].replace(/+/g, '%20')) || null
    }
原文地址:https://www.cnblogs.com/wangyihong/p/11897790.html