直接调用函数即可,函数如下:
function getURLParam(name) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)', "ig")
.exec(location.search) || [, ""])[1].replace(/\+/g, '%20')) || null;
}
调用如:
var id = getURLParam("id");
直接调用函数即可,函数如下:
function getURLParam(name) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)', "ig")
.exec(location.search) || [, ""])[1].replace(/\+/g, '%20')) || null;
}
调用如:
var id = getURLParam("id");