📅  最后修改于: 2022-03-11 15:03:46.948000             🧑  作者: Mango
function getSearchParameters() { var prmstr = window.location.search.substr(1); return prmstr != null && prmstr != "" ? transformToAssocArray(prmstr) : {}; } function transformToAssocArray( prmstr ) { var params = {}; var prmarr = prmstr.split("&"); for ( var i = 0; i < prmarr.length; i++) { var tmparr = prmarr[i].split("="); params[tmparr[0]] = tmparr[1]; } return params; } var params = getSearchParameters();