This article is the use of JS set URL parameters of the implementation code for a detailed analysis of the introduction, the need for friends under the reference
//Get the Address bar array of parameters
function Geturlparams () {
var search = Window.location.search;
//Write Data dictionary
var tmparray = search.substr (1, search.length). Split ("&");
var paramsarray = new Array;
if (Tmparray!= null) {
for (var i = 0; i < tmparray.length; i++) {
var reg =/[=|^==]/; Split with =, excluding = =
var Set1 = tmparray[i].replace (Reg, ' & ');
var tmpStr2 = set1.split (' & ');
var array = new Array;
array[tmpstr2[0]] = tmpstr2[1];
Paramsarray.push (array);
}
}
//Returns the parameter array
return paramsarray;
}
//Get parameter value based on parameter name
function GetParamValue (name) {
var paramsarray = Geturlparams ();
if (Paramsarray!= null) {
for (var i = 0; i < paramsarray.length; i++) {
for (Var j in Paramsarray[i]) {
if (j = = name) {
return PARAMSARRAY[I][J];
}
}
}
}
return null;
}