一、单个值
var url = location.search; //获取url中"?"符后的字串
location.search.split("=")[1]
//=后面保留
二、多个值
function GetQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if(r != null) return(r[2]);
return null;
}
this.invite_no = GetQueryString("invite_no")
this.date = GetQueryString("date").split("/")[0] + "年" + GetQueryString("date").split("/")[1] + "月" + GetQueryString("date").split("/")[2] + "日"
this.name = decodeURI(GetQueryString("name"));
this.tel = GetQueryString("tel")
this.beizhu = decodeURI(GetQueryString("beizhu"));
中文乱码用decodeURL解码