Error handling in getJSON calls
How can you handle errors in a getJSON call? Im trying to reference a cross-domain script service using jsonp, how do you register an error method? Luciano Costa $.getJSON() is a kind of abstraction of a regular AJAX call where you would have to tell that you want a JSON encoded response. $.ajax({ url: url, dataType: 'json', data: data, success: callback }); You can handle errors in two ways: generically (by configuring your AJAX calls before actually calling them) or specifically (with method chain). 'generic' would be something like: $.ajaxSetup({ "error":function() { alert("error"); } });