1 var url="http://127.0.0.1:8080/photo/list.jsp?page=2&user=hongchen"; 2 var params_arr = url.substr(url.indexOf('?')+1).split("&"); 3 var params = new Array(); 4 for (var i = params_arr.length - 1; i >= 0; i--) { 5 params[params_arr[i].split("=")[0]] = params_arr[i].split("=")[1]; 6 }; 7 alert(params["page"]);