Bug Tracker

Modify

Ticket #11179 (closed bug: worksforme)

Opened 17 months ago

Last modified 17 months ago

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:
Blocking: Blocked by:

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

comment:1 follow-up: ↓ 2 Changed 17 months ago by dmethvin

  • Owner set to aldaruru@…
  • Status changed from new to pending

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 17 months ago by anonymous

 http://jsfiddle.net/NNZnx/

but the behavior is not well replicated in jsfiddle

comment:3 Changed 17 months ago by dmethvin

  • Status changed from pending to closed
  • Resolution set to worksforme

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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.