url : index.php?id=123 复制代码 代码如下: <br>function GetRequest() { <br>var url = location.search; //获取url中"?"符后的字串 <br>var theRequest = new Object(); <br>if (url.indexOf("?") != -1) { <br>var str = url.substr(1); <br>strs = str.split("&"); <br>for ( var i = 0; i < strs.length; i ) { <BR>theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]); <BR>} <BR>} <BR>return theRequest; <BR>} <BR>var Request=undefined; <BR>Request=GetRequest(); <BR>var id=Request["id"]; <BR>