Bug Tracker

Opened 8 years ago

Closed 8 years ago

#11179 closed bug (worksforme)

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

Reported by: aldaruru@… Owned by: aldaruru@…
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.

Change History (3)

comment:1 Changed 8 years ago by dmethvin

Owner: set to aldaruru@…
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.

comment:2 in reply to:  1 Changed 8 years ago by anonymous

http://jsfiddle.net/NNZnx/

but the behavior is not well replicated in jsfiddle

comment:3 Changed 8 years ago by dmethvin

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.

Note: See TracTickets for help on using tickets.