HTML也可以通过JS来到得参数,函数如下(我将它保存到了一个数组里面)://--------------------------------------------------------------------------//Name: GetArgsFromHref////Pupers: the function will get the parameters from the server////Parameter://sHref---->>the current URL//sArgName---->>the Array store the name of parameters which you want to get////Return: Array to store the result////Author: Jkallen//----------------------------------------------------------------------------function GetArgsFromHref(sHref, sArgName){ var args = sHref.split("?"); var p_Result = new Array(); if(args[0] == sHref) { return p_Result; } var str = args[1]; args = str.split("&"); for(var i = 0; i < args.length; i ++) { str = args[i]; var arg = str.split("="); if(arg.length <= 1) continue; if(sArgName != null) { for(var c1 = 0; c1 < sArgName.length; c1++) { var tempValue = arg[0]; if( tempValue == sArgName[c1]) p_Result[tempValue] = arg[1]; } }//end if }//end for return p_Result; }//end GetArgsFromHref