I have an app with >> 50 calls to $.getJSON(“…”, function(data) {…} );
At the start we didn’t need to worry about handling callback failures.
Now we do occassionally chain a .error() to the end of the JSON call. This works fine.
Now we have decided it best to do this for every call. Is there any way to tweak JQuery so that I can have the .error() chained to the end of every call with some default error handling as opposed to having to modify every .js file I have that uses this method?
Thanks …. J
You can use jQuery ajaxSetup:
http://api.jquery.com/jQuery.ajaxSetup/
With this method you will be able to set global jquery ajax options.