页面跳转时候拼接在url后面的多个 参数获取

 1   function GetRequest() {
 2         var url = location.search;
 3         var theRequest = new Object();
 4         if (url.indexOf("?") != -1) {
 5             var str = url.substr(1);
 6             strs = str.split("&");
 7             for (var i = 0; i < strs.length; i++) {
 8                 theRequest[strs[i].split("=")[0]] = decodeURI(strs[i].split("=")[1]);
 9             }
10         }
11         console.log(theRequest)
12         return theRequest;
13     }
14     var params={};
15     params=GetRequest();
16     var processDefinitionName=params['processDefinitionName'];

 

posted @ 2018-06-06 13:47  前端极客  阅读(13143)  评论(0编辑  收藏  举报