function getURLParameter(name) { return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null}
So you can use:
myvar = getURLParameter('myvar');
本文共 229 字,大约阅读时间需要 1 分钟。
function getURLParameter(name) { return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null}
So you can use:
myvar = getURLParameter('myvar');
转载地址:http://iqezl.baihongyu.com/