Skip to main content

Bug Tracker

Side navigation

#11179 closed bug (worksforme)

Opened January 16, 2012 02:47PM UTC

Closed January 16, 2012 07:12PM UTC

Why success event in jquery.ajax is fired when the ajax status code is 0?

Reported by: aldaruru@gmail.com Owned by: aldaruru@gmail.com
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:
Description

If the destination is unreachable I think that it is an error event. only the status code 200 should be the success event.

Thanks.

Attachments (0)
Change History (3)

Changed January 16, 2012 02:49PM UTC by dmethvin comment:1

owner: → aldaruru@gmail.com
status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket!

Additionally, be sure to test against the "jQuery (edge)" version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to begin.

Sounds like you may have isLocal set.

Changed January 16, 2012 06:05PM UTC by anonymous comment:2

http://jsfiddle.net/NNZnx/

but the behavior is not well replicated in jsfiddle

Changed January 16, 2012 07:12PM UTC by dmethvin comment:3

resolution: → worksforme
status: pendingclosed

Here is a corrected fiddle, but it seems to return 200 as expected.

http://jsfiddle.net/NNZnx/1/

As I mentioned, one reason for an $.ajax() call returning success on 0 is that you have specified isLocal: true in the ajax settings. Ask for help on a forum until you've isolated it to a true bug.