html_获取参数

 1 function GetRequest() {
 2     var urlStr=location.href;
 3     if (typeof urlStr == "undefined") {
 4         var url = decodeURI(location.search); //获取url中"?"符后的字符串
 5     } else {
 6         var url = "?" + urlStr.split("?")[1];
 7     }
 8     var theRequest = new Object();
 9     if (url.indexOf("?") != -1) {
10         var str = url.substr(1);
11         strs = str.split("&");
12         for (var i = 0; i < strs.length; i++) {
13             theRequest[strs[i].split("=")[0]] = decodeURI(strs[i].split("=")[1]);
14         }
15     }
16     return theRequest;
17 }
18 $(function() {
19     var parms_2 = GetRequest();
20     Login_name=parms_2['Login_name'];
21 });

 

posted @ 2020-11-26 14:14  博二爷  阅读(853)  评论(0编辑  收藏  举报