获取浏览器地址栏参数

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

  

posted @ 2016-03-29 13:58  Nihaorz  阅读(526)  评论(2编辑  收藏  举报