alert(GetQueryString(參數(shù)名1));alert(GetQueryString(參數(shù)名2));alert(GetQueryString(參數(shù)名3));方式二:輸入指令:Script language=javascript function GetRequest() { var url = location.search; //獲取url中?符后的字串 var theRequest = new Object();if (url.indexOf(?) != -1) { var...
用JS獲取地址欄參數(shù)的方法(超級簡單)方法一:采用正則表達(dá)式獲取地址欄參數(shù):( 強(qiáng)烈推薦,既實用又方便?。ゝunction GetQueryString(name){ var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if(r!=null)ret...