[jQuery] Re: Ajax error handling & textStatus

2009-12-29 Thread anatoly techtonik
What about $.load() callback? Seems like its called in all possible cases. The only disadvantage is error checking - is there any helper in jQuery to check textStatus for error? This one is not particularly beautiful. if (textStatus == 'error' || textStatus == 'timeout' || textStatus == 'parsererr

[jQuery] Re: Ajax error handling & textStatus

2009-12-09 Thread T.J. Simmons
No problem, glad to help. -T.J. On Dec 9, 1:12 pm, Cameron van den Bergh wrote: > Thank you for this information, indeed, i was using $.get. > > On 9 déc, 18:13, "T.J. Simmons" wrote: > > > > > Are you using $.ajax or one of the other AJAX functions? $.get and the > > rest only execute a callba

[jQuery] Re: Ajax error handling & textStatus

2009-12-09 Thread Cameron van den Bergh
Thank you for this information, indeed, i was using $.get. On 9 déc, 18:13, "T.J. Simmons" wrote: > Are you using $.ajax or one of the other AJAX functions? $.get and the > rest only execute a callback upon success; you'll need to use $.ajax > if you want a callback for an error. > > http://docs.

[jQuery] Re: Ajax error handling & textStatus

2009-12-09 Thread T.J. Simmons
Are you using $.ajax or one of the other AJAX functions? $.get and the rest only execute a callback upon success; you'll need to use $.ajax if you want a callback for an error. http://docs.jquery.com/Ajax/jQuery.get#urldatacallbacktype has some more information on that. -T.J. On Dec 9, 6:30 am,

[jQuery] Re: ajax error handling

2009-06-14 Thread Peter Marino
Hi, I'll just followup on my own statement.. I found the solution I was looking for. when calling $.ajax it has an event called error you can act on. error: function( XMLHttpRequest, textStatus, errorThrown ) the XMLHttpRequest has a method called responseText which is the actually text that the

[jQuery] Re: ajax error handling

2009-06-14 Thread MorningZ
I also deal with JSON almost exclusively (albiet in .NET, but getting the server side error would be the same) since $.getJSON doesn't handle error events, I wrote this simple wrapper around the $.ajax function GetAjax = function(url, params, success, error) { var CallParams = {}; CallPa

[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

[jQuery] Re: ajax 'error'

2007-09-04 Thread seedy
I figured it out thought I might as well post the answer for others. In .net 1.1 you can use the Response.StatusCode to set it to a bad status (500), and response.write to send text. This will cause jQuery to call the error callback, and from there you can use xhr.responseText to read any text

[jQuery] Re: AJAX error in IE with jQuery 1.1.3

2007-08-16 Thread [EMAIL PROTECTED]
Pleae paste your codes. On 8月17日, 上午3时05分, "Estev o Lucas" <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to know if somebody already had problems with IE when using the > method of ajax with jQuery 1.1.3. The generated error was "object does not > support this property or the method" and "acc

[jQuery] Re: .ajax error function

2007-08-06 Thread Joe
Mike, Thanks for the information. It was very helpful. I end up using firebug and was able to get the server response status. Much easier to fix when you know what's happening! On Aug 2, 2:41 pm, "Mike Alsup" <[EMAIL PROTECTED]> wrote: > Anajaxcall can error out if: > > - it times out (per the t

[jQuery] Re: .ajax error function

2007-08-02 Thread Mike Alsup
An ajax call can error out if: - it times out (per the timeout option) - the server response status indicates an error (ie: 401, 404) - an exception is thrown during the send operation - an exception is thrown when processing the response The last item above is especially interesting because it

[jQuery] Re: AJaX Error

2007-05-04 Thread Rob Wilkerson
I guess I may have to try that. I've been trying to get the server not to care, but maybe it isn't possible. On 5/3/07, Ⓙⓐⓚⓔ <[EMAIL PROTECTED]> wrote: I bet your server is killing the week long php report, can you get the json to appear on it's own? I've not gotten timed out in a very long ti

[jQuery] Re: AJaX Error

2007-05-03 Thread Ⓙⓐⓚⓔ
I bet your server is killing the week long php report, can you get the json to appear on it's own? I've not gotten timed out in a very long time. a fast server program makes a happy ajaxer! perhaps you need to create the report in one call and continually check to see if it is done. On 5/3/07, R

[jQuery] Re: AJaX Error

2007-05-03 Thread Rob Wilkerson
A bit more on this: Whatever is happening, whether it's a timeout or code error seems to happen after approximately 5 minutes of waiting for a response. I'd really appreciate any input you all may have. On 5/3/07, Rob Wilkerson <[EMAIL PROTECTED]> wrote: > I don't think this is jQuery specific,

[jQuery] Re: ajax Error

2007-04-21 Thread jiraponga
Dear SiCo, I'm not sure what kind of error that you want to trigger. But for XHR, usually, it is the errors that may cause between browser and webserver. If it is what you want, please refer to http://en.wikipedia.org/wiki/List_of_HTTP_status_codes Below code is what I'm using. - It makes a cal

[jQuery] Re: ajax Error

2007-04-21 Thread SiCo
Thanks for the tips so far, I will try it later. The weird thing I've just noticed is that the PHP runs fine and responds with the correct messages (XML - Added ok - etc etc) but the ajax error function fires, hence why I want to see the exact message. I will try try alerting xhr.responseText and

[jQuery] Re: ajax Error

2007-04-20 Thread Ⓙⓐⓚⓔ
second parameter contains the word error, that's all!!! the real error is inside the text inside xhr parameter. error gets an xhr result and the status and maybe an exception object. try alerting xhr.responseText. PS it's not xhtml but the xrh. from the source: (Function) error - A function to

[jQuery] Re: ajax Error

2007-04-20 Thread Sean Catchpole
Hi Simon, I'd recommend using http://jquery.com/api/ and firebug to help you debug. You're function looks ok, but I think error is an object that contains lots of data. Check out $.ajaxError at the api I linked. Let me know if you have more questions. ~Sean