Reputation: 2387
on Jquery websites says that i should attach ajaxError method to some html elemnt.
It means i have to have such element. But i wont use it.
I want to have one global handler which will handle all ajax error messages.
I've tried like here jquery Ajax $.ajaxError
but i'm getting error message
and line 16 is
Upvotes: 1
Views: 1563
Reputation: 980
You have to attach the handler to any element. And to make it global:
$(document).ajaxError(function(){...
http://api.jquery.com/ajaxError/
Upvotes: 3
Reputation: 1038710
How about attaching it to the document
:
$(document).ajaxError(function(event, jqXHR, ajaxSettings, thrownError) {
...
});
Upvotes: 1