.ajax方法:$.ajax({ url:"${pageContext.request.contextPath}/user/checkUserName", data:{"username":username}, type:"post", dataType:"json", success:function (data) { alert(data); } });
.post方法
$.post(
"${pageContext.request.contextPath}/user/isUniqueUsername", //url
{"username":username}, //data
function(data){}, //success
'text' //dataType
);