标签:style blog io ar color sp java on div
function getURLParameter(name) { return decodeURIComponent((new RegExp(‘[?|&]‘ + name + ‘=‘ + ‘([^&;]+?)(&|#|;|$)‘).exec(location.search)||[,""])[1].replace(/\+/g, ‘%20‘))||null }
So you can use:
myvar = getURLParameter(‘myvar‘);
How to get URL parameters with Javascript?
标签:style blog io ar color sp java on div
原文地址:http://www.cnblogs.com/dupeng0811/p/How_to_get_URL_parameters_with_Javascript.html