views:

20

answers:

1

Hi, The global events ajaxSuccess and ajaxError are not working properly for me. I disconnected my Internet connection and ajaxSuccess handler executes with xhr.status=0, and ajaxError is not executing at all. I need you to confirm if this is bug or am I doing something wrong?

Thanks!

+1  A: 

It is a bug, a 0 being "successful" was originally added because Opera returns a 304 as a 0, or at least used to, you can see it in a comment in the jQuery core code here.

However if you look at the main branch, you'll see this status == 0 exception has been removed for the jQuery 1.5 release, so it's already fixed and you'll see this fix in 1.5.

Nick Craver
So it's a bug. I also suspected that.
Nazaf
Thanks, Nick Craver!
Nazaf
@Nazaf - I'd say so, or more accurately it's a code check that does more harm than good, so you could see it from either side....and welcome :)
Nick Craver