window.getRequest = function (url) { var theRequest = new Array(); if (url.indexOf("?") > -1) { var pair = url.substr(1).split("&"); for (var i = 0; i < pair.length; i++) { var key = pair[i].split("=")[0]; var value = decodeURI(pair[i].split("=")[1]); var item = { key: value} theRequest.push(item); //theRequest[pair[i].split("=")[0]] = decodeURI(pair[i].split("=")[1]); } } return theRequest; };
时间: 2024-10-07 09:37:49