1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | $.ajax({ //几个参数需要注意一下 type: "POST" , //方法类型 dataType: "json" , //预期服务器返回的数据类型 url: "./PersonalEditHandle" , //url data: $( '#form2' ).serialize(), success: function (result) { if (result.code == 1) { //预期服务器响应{code: 1, message: "修改成功!"} alert(result.message); } }, error : function() { alert( "异常!" ); } }); |