Home >Web Front-end >JS Tutorial >Get the parameters behind the request
function getSearchObj() { var url = getSearch(); var searchObj = {}; if (url) { // 去掉?号 url = url.substr(1); if (url.length > 0) { var arr = url.split("&"); for (var i = 0; i 0 && keyVal.indexOf("=") > 0) { var keyValArr = keyVal.split("="); var key = keyValArr[0]; var val = keyValArr[1]; searchObj[key] = val; } } } } return searchObj; }