jQuery升级和AJAX
|
我刚刚从1.4升级到JQuery 1.5.2,而PostForm现在无法正常工作。它确实会发布到页面,但是即使没有错误也表示存在错误。
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);
}
没有找到相关结果
已邀请:
3 个回复
补蹲农界维
,您应该定义的是
:
定义您希望脚本返回的数据类型(xml,json,脚本或html),而
传递您在请求中发送的内容类型。 您可以在jQuery API上阅读有关这些选项的更多信息:http://api.jquery.com/jQuery.ajax/
摊揉售
无需显式指定
。
裸雷胜檀哭