> Is this possible? I do not want to use the $.ajaxError event but > catching the error directly like this: > > try > { > $.getJSON(.....);} > > catch (x) > { > alert("failed"); > > } > >
No, that won't work. Either use the global error handler or use $.ajax instead of $.getJSON and pass in a local error handler. http://docs.jquery.com/Ajax/jQuery.ajax#options