我有以下代码通过.ajax call. When
.ajax executes it redirects to an
错误处理程序获取一些数据。如何获得ajax调用中的错误描述
$(document).ready(function(){
$('#ctl00_ContentMain_ddlRegions').change(function(){
region = $(this).val();
alert(region);
});
$('input[type="text"]').autocomplete({
source: function(request, response)
{
$.ajax({
url: "EmailActivation/EmailActivation.asmx/GetIsoFromRegion",
data: "{ 'region': '" + region + "'}",
dataType: "json",
type: "POST",
contentType: "application/json; charset=utf-8",
success: function(data){
alert("success");
},
error: function(response){
alert("error: fails");
},
failure: function(response){
alert("failure: fails");
}
});
},
select: function(e,i){
$("#<%=hfIso.ClientID %>").val("retrieved");
},
minLength: 4
});
});
我怎样才能找出我得到的错误,所以我可以修复发生的任何事情?
谢谢
你已经在参数:error:function(response)
响应是错误对象,你可以玩它.. – Sekai