我剛從1.4升級到JQuery 1.5.2,我的PostForm現在不能工作。它發佈到頁面,但即使沒有錯誤,它說有錯誤。JQuery升級和AJAX
function TestPostForm(){
$.ajax({
type: "POST",
url: "process.jsp",
data: 'operation=Test&ui=TestUser',
dataType: "application/x-www-form-urlencoded",
async: false,
success: function(response) {
alert('Success');
return response;
},
error: function(xhr, ajaxOptions, thrownError) {
alert("There was an error : " + xhr.status);
}
});
}
Java代碼:process.jsp
if (operation.equals("Test")) {
String ui = request.getParameter("ui");
out.println("Ok" + ui);
}
什麼是'out' var。它會得到迴應嗎? – Neal 2011-04-18 19:07:44