根据URL获取参数

getQueryString(name) {
  return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ""])[1].replace(/\+/g, '%20')) || null;
},//decodeURIComponent() 函数可对 encodeURIComponent() 函数编码的 URI 进行解码,可去掉。

猜你喜欢

转载自blog.csdn.net/m0_37646522/article/details/79731945
今日推荐