<Script language = "JavaScript" type = "text/JavaScript">
// JS obtains the function of the URL parameter
Function request (paras ){
VaR url = location. href;
VaR parastring = URL. substring (URL. indexof ("? ") + 1, URL. Length). Split ("&");
VaR paraobj = {}
For (I = 0; j = parastring [I]; I ++ ){
Paraobj [J. substring (0, J. indexof ("="). tolowercase ()] = J. substring (J. indexof
("=") + 1, J. Length );
}
VaR returnvalue = paraobj [paras. tolowercase ()];
If (typeof (returnvalue) = "undefined "){
Return "";
} Else {
Return returnvalue;
}
}
VaR theurl
Theurl = request ("url ");
If (theurl! = ''){
Location = theurl
}
</SCRIPT>
This article is from: script House (Www.jb51.net) For details, refer:Http://www.jb51.net/article/13242.htm
----------------------------------------------------------
<Script language = "JavaScript" type = "text/JavaScript">
Function Local (ID, addid, color)
{
// Var url = Window. Location. search;
VaR url_arr = geturlrequest (window. Location. href). Split ('|'); // obtain the current page request set and store it in an array.
For (I = 0; I <url_arr.length; I ++)
{
Alert ('this is the '+ I +' request value: '+ url_arr [I]);
}
}
Function geturlrequest (URL)
{
VaR U, G, strback = '', returnvalue = "";
If (arguments [arguments. Length-1] = "#") {u = URL. Split ("#") ;}else {u = URL. Split ("? ");}
If (U. Length = 1) g = ''; else G = U [1];
If (G! = '')
{
Gg = G. Split ("&");
VaR Maxi = GG. length;
STR = arguments [0] + "= ";
For (XM = 0; XM <Maxi; XM ++)
{
If (Gg [XM]. indexof (STR) = 0)
{
Strback = Gg [XM]. Replace (STR ,"");
Break;
}
Returnvalue + = Gg [XM]. substring (Gg [XM]. indexof ('=') + 1) + "| ";
}
}
Return returnvalue. substring (0, returnvalue. Length-1 );
}
</SCRIPT>