1

So I am trying find out if the property "failure" is correct for the following AJAX call. I am finding it all over the place in a new web application I am working on and cannot seem to find it being used in JQuery API docs:

$.ajax({
    type: "POST",
    url: '/AdminTools/HydrateSelectFromDistrict/',
    data: queryStr,
    dataType: 'html',
    beforeSend: OnBegin,
    success: OnDistrictChangeSuccess,
    failure: OnFailure,
    timeout: 5000
});

Shouldn't that property be "error", not "failure"? Never seen the property "failure" used in an AJAX callback

Slinky
  • 5,662
  • 14
  • 76
  • 130

1 Answers1

1

I think you're right. It should be "error". I've never seen "failure" either and it isn't in the documentation. I also did not find it in the jQuery code itself.

http://api.jquery.com/jquery.ajax/

allen1
  • 714
  • 5
  • 13