Bug Tracker

Modify

Ticket #6241 (closed bug: fixed)

Opened 3 years ago

Last modified 14 months ago

$.ajax calls the success callback in FF 3.5.8 for failed cross-origin requests.

Reported by: jambo Owned by:
Priority: undecided Milestone: 1.4.3
Component: ajax Version: 1.4.2
Keywords: Cc: jambo
Blocking: Blocked by:

Description

In Firefox 3.5.8, when I attempt an illegal cross-origin request, the "success" callback is still called. Firefox's response to an illegal cross-origin request is now to blank xhr.responseText and set xhr.status to zero, even though xhr.readyState === 4.

This should be reproducable by simply attempting a cross-origin request to a domain that does not support it, for example with the following code:

$.ajax({

url : " http://www.example.com/", success : function() {

alert( "Oops!" );

}

});

Change History

comment:1 Changed 3 years ago by maqdev

The same with: Google Chrome 5, Safari 4.0.4 (Win)

Also this problem is reproduced not only for cross-origin request, but when server is down and closes connection without any HTTP status response (in last case reproduced with IE8 too).

comment:2 Changed 3 years ago by maqdev

Here is similar problem and a fix that could help:

 http://dev.jquery.com/ticket/6060

comment:3 Changed 3 years ago by curiousdannii

Can be closed as #6060 has been fixed.

comment:4 Changed 3 years ago by addyosmani

  • Priority set to undecided
  • Status changed from new to closed
  • Resolution set to fixed

Closing as we've fixed this.

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.