$.ajax({
url : "UserController/UserLogin",
type : "get",
data : {"username" : username,
"password" : password},
dataType : "json",
success : function(data){
alert(data.code);
window.location.href = "Goods.jsp";
},
error : function(){
alert("bbbb");
}
});
$.post("UserController/addUser", {
"name" : name,
"username" : username,
"password" : password
}, alert("注册成功"), // John
"json");