[jQuery] Re: ajax error handling troubles

2008-12-16 Thread Mike Alsup
> jQuery.ajax({ >         type: 'GET', >         url: "http://picasaweb.google.com/data/feed/base/user/ > picasa_non_esistent_user?kind=album&alt=json", >         dataType: 'jsonp', >         error: function (xhr, ajaxOptions, thrownError) { >             alert("error triggered"); >             if

[jQuery] Re: ajax error handling troubles

2008-12-16 Thread Luca Barbato
On Dec 15, 3:06 am, MareceK wrote: > Solution: > > error: function (xhr, ajaxOptions, thrownError) { > if(xhr.status == 404) { > // 404 error > } jQuery.ajax({ type: 'GET', url: "http://picasaweb.google.com/data/feed/base/user/ picasa_non_esistent_user?kind=album&alt=jso

[jQuery] Re: ajax error handling troubles

2008-12-14 Thread MareceK
Solution: error: function (xhr, ajaxOptions, thrownError) { if(xhr.status == 404) { // 404 error } else if(xhr.status == 403) { // 403 error } else { // default error } } On 17. Nov, 03:12 h., Mike Alsup wrote: > > errorThrown is for JavaScript errors (think try/catch).

[jQuery] Re: ajax error handling troubles

2008-11-16 Thread Mike Alsup
> errorThrown is for JavaScript errors (think try/catch).  40X responses > are not "thrown", they are just errors returned from the server and > you can get details from the xhr (ie: xhr.statusText). To elaborate slightly, the server could return an XML document with a 200 status code. But if th

[jQuery] Re: ajax error handling troubles

2008-11-16 Thread Mike Alsup
>                 $.ajax({ >                         async: true, >                         url: testingURL, >                         success: function () { >                                 location.reload(); >                         }, >                         error: function (XMLHttpRequest,

[jQuery] Re: ajax error handling troubles

2008-11-16 Thread Karl Rudd
The documentation for the ajax error function has this note in the example: // typically only one of textStatus or errorThrown // will have info ( http://docs.jquery.com/Ajax/jQuery.ajax#toptions ) Perhaps check the textStatus as well as the errorThrown? Karl Rudd On Mon, Nov 17, 2008 at