获取通过url传递的参数

2017-06-16  本文已影响18人  青檬眼豆豆

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);
}

上一篇下一篇

猜你喜欢

热点阅读