//解析地址栏获取指定参数
function QueryParamString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) {
return decodeURI(r[2]);
} else {
return null;
}
}
/*替换地址栏指定参数值*/
function replaceParamVal(name,value) {
var oUrl = this.location.href.toString();
var re=eval('/('+ name+'=)([^&]*)/gi');
var nUrl = oUrl.replace(re,name+'='+value);
return nUrl;
}
function replaceParamVal(name,value) {
var oUrl = this.location.href.toString();;
var re = new RegExp("("+ name+"=)([^&]*)", "i");
var nUrl = oUrl.replace(re,name+'='+value);
return nUrl;
}