var url = "http://www.taobao.com/index.php?key0=0&key1=1&key2=2............."; var obj = parseQueryString(url); function parseQueryString(argu){ var str = argu.split(‘?‘)[1]; var result = {}; var temp = str.split(‘&‘); for(var i=0; i<temp.length; i++) { var temp2 = temp[i].split(‘=‘); result[temp2[0]] = temp2[1]; } return result; }
时间: 2024-10-13 09:04:23