js获取地址栏参数

js获取地址栏参数

js获取地址栏参数:

getParam(name) {
      return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ""])[1].replace(/\+/g, '%20')) || null
    }

 

posted on 2019-11-20 14:56  梦幻飞雪  阅读(186)  评论(0编辑  收藏  举报