只需要在js里面调用如下方法即可
//下面是获取上一个页面a标签activityId传过来的值
var url = window.location;
function getUrlParam(url,name){
var pattern = new RegExp("[?&]" + name +"\=([^&]+)","g");
var matcher = pattern.exec(url);
var items = null;
if(matcher != null){
try{
items = decodeURIComponent(decodeURIComponent(matcher[1]));
}catch(e){
try{
items = decodeURIComponent(matcher[1]);
}catch(e){
items = matcher[1];
}
}
}
return items;
}
调用的代码是
var ActivityID=getUrlParam(url,'ActivityID');//获取上一个界面传过来的id
注意url不用改