I have a global ajaxError event, like:

$(document).ajaxError(function myErrorHandler(event, xhr, ajaxOptions, thrownError) { alert("There was a global ajax error!"); }); 

And I have a lot of local ajaxEvents, like these:

 $(imageUploadForm).ajaxForm({ url: assetsUplUrl, type: 'POST', dataType: 'json', data: {project_id: projectId, type: 'image', widget: widget}, error: function(responseText, status, xhr, form){ alert("There was a local ajax error!"); } }); 

How can I trigger a global ajaxError before one of the local error events fires?

  • what ajaxError and ajaxForm ? Is a global event triggered? - Grundy
  • ajaxError sets an Ajax event handler when an Ajax request completes with an error. ajaxForm is an example of local ajax. The fact is that the local Ajax works earlier than the global one, and I have to make the global one work before the global one - Sergey Stotsky

0