user342552
user342552

Reputation:

jQuery ajaxSuccess and ajaxError behavior

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!

Upvotes: 0

Views: 344

Answers (1)

Nick Craver
Nick Craver

Reputation: 630429

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.

Upvotes: 1

Related Questions