Previously I wrote about the function for jump menu positioning after the static page is refreshed. I had nothing to do with it a few days ago. It still seems a bit problematic and Its versatility is not good, so I wrote the following static page to obtain the function for passing URL parameters. By the way, the elements on the HTML page can not only use the default labels, but can be added by myself, for example: <input name = "infofileid" type = "hidden" gotourl = "#" id = "infofileid"> do you see the gotourl? It is convenient to use it directly. It is accidentally used when writing a function.
Function getquerystring (querystringname)
{
VaR returnvalue = "";
VaR urlstring = new string (document. Location );
VaR serachlocation =-1;
VaR querystringlength = querystringname. length;
Do
{
Serachlocation = urlstring. indexof (querystringname + "/= ");
If (serachlocation! =-1)
{
If (urlstring. charat (serachLocation-1) = '? ') | (Urlstring. charat (serachLocation-1) = '&'))
{
Urlstring = urlstring. substr (serachlocation );
Break;
}
Urlstring = urlstring. substr (serachlocation + querystringlength + 1 );
}
}
While (serachlocation! =-1)
If (serachlocation! =-1)
{
VaR seperatorlocation = urlstring. indexof ("&");
If (seperatorlocation =-1)
{
Returnvalue = urlstring. substr (querystringlength + 1 );
}
Else
{
Returnvalue = urlstring. substring (querystringlength + 1, seperatorlocation );
}
}
Return returnvalue;
}