<script type= "text/JavaScript ">//getArray function Get for querystringQueryString () { var result = Location.search.match (new RegExp ("[\?\&][^\?\&]+=[^\?\&]+ "," G ")); if (result = = null) { return" "; } for (var i = 0; i < result.length; i++) { result[i ] = result[i].substring (1); } return result;} Gets the value function getquerystringbyname (name) { var result = Location.search.match (new) According to the QueryString parameter name RegExp ("[\?\&]" + name + "= ([^\&]+)", "I")); if (result = = NULL | | Result.length < 1) { return ""; } return result[1];} Gets the value function Getquerystringbyindex (index) { if (index = = null) According to the QueryString parameter index { return ""; } var querystringlist = GetquerystRing (); if (index >= querystringlist.length) { return ""; } var result = querystringlist[index]; var startIndex = Result.indexof ("=") + 1; result = result.substring (startIndex); return result; Alert (getquerystring ()) Alert (Getquerystringbyname ("user")) Alert (Getquerystringbyindex ("0")) alert ( Getquerystringbyindex ("1")) </script>
JavaScript get URL parameters