获取浏览器地址栏参数

1
2
3
4
function getURLParameter(name) {
  return decodeURIComponent((new RegExp('[?|&]' + name + '=' '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null;
};
var token = getURLParameter("token");

  

posted @ 2024-04-09 12:16  吕金林  阅读(14)  评论(0)    收藏  举报