All data is available under
(所有数据均可在)
window.location.search
you have to parse the string, eg.
(你必须解析字符串,例如。)
function get(name){
if(name=(new RegExp('[?&]'+encodeURIComponent(name)+'=([^&]*)')).exec(location.search))
return decodeURIComponent(name[1]);
}
just call the function with GET variable name as parameter, eg.
(只需使用GET变量名称作为参数调用该函数,例如。)
get('foo');
this function will return the variables value or undefined if variable has no value or doesn't exist
(如果变量没有值或不存在,此函数将返回变量值或undefined)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…