就以本问题的地址为例 var params = window.location.search; var param = {}; var arr = params.split("&"); for(var i =0;i<arr.length;i++){ var pa = arr[i]; pa_arr = pa.split("="); param[pa_arr[0]] = pa_arr[1]; }
最后得到的结果将是 var param = { fr:"uc_push", push:"category", entry:"uhome_new", oldq:"1" };