获取URL中的参数

it2022-05-05  106

获取URL中的参数

var mac = getUrlParam("mac"); console.log("mac:" + mac); //获取url中的参数 function getUrlParam (name) {//获取页面之间的传参 return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(parent.window.location.search) || [, ""])[1].replace(/\+/g, ' ')) || null; };

 


最新回复(0)