获取通过url传递的参数

window.onload = function(){
var page_state = getQueryString("apply");
if(page_state == 'info'){
$('.foot-item-me').trigger('click');
}else{
$('.foot-item-menu').trigger('click');
}
};
function getQueryString(val){
//截取url中?后面的字符串
var uri = window.location.search;
var re = new RegExp("[?&]" +val+ "=([^&?]*)", "ig");
return ((uri.match(re))?(uri.match(re)[0].substr(val.length+2)):null);
}

你可能感兴趣的:(获取通过url传递的参数)