复制代码代码如下 :
function getParam(nomParam) {
paramValue = "";
isFound = faux ;
if (this.location.search.indexOf("?") == 0 && this.location.search.indexOf("=") > 1) {
arrSource = unescape(this.location.search).substring(1, this.location.search.length).split("&");
je = 0 ;
while (i < arrSource.length && !isFound) {
if (arrSource[i].indexOf("=") > 0) {
if (arrSource[i].split("=")[0].toLowerCase() == paramName.toLowerCase()) {
paramValue = arrSource[i].split("=")[1];
isFound = vrai ;
}
}
je++;
}
}
retourner paramValue ;
}
Ici://www.VeVB.COm/UserQuery.aspx?id=202
getParam("id") à 202