js获取get、post的值

it2022-05-05  102

<script>function get_get(){ querystr = window.location.href.split("?")if(querystr[1]){GETs = querystr[1].split("&")GET =new Array()for(i=0;i<GETs.length;i++){tmp_arr = GETs[i].split("=")key=tmp_arr[0]GET[key] = tmp_arr[1]}}return querystr[1];}//如果地址是 test.htm?t1=1&t2=2&t3=3, 那么能取得:GET["t1"], GET["t2"], GET["t3"]</script>

转载于:https://www.cnblogs.com/sishahu/archive/2011/09/16/2178419.html


最新回复(0)