Bug Tracker

Ticket #2994 (new bug)

Opened 3 months ago

Last modified 3 months ago

Jquery $.ajax event error problem

Reported by: Jeff Assigned to: anonymous
Type: bug Priority: major
Milestone: 1.3 Component: ajax
Version: 1.2.6 Keywords: $.ajax 404 event error problem
Cc: Needs: Review

Description

Hi all, I have a problem on ajax error event handler with non existing file on url parameter -> 404 feedback ( the other event success / complete works fine all browser ). With the code below, FF 2.0.0.14 and OPERA 9.27 fire error event but IE 7 and SAFARI 3.1.1 not.

Thanks in advance, i start to look in your code ...

$.ajax (
	 {
	 type: 'POST',
	 url: 'a file that do not exist',
  	 dataType: 'HTML',
         data :'test=1',
	 success: function (data, textStatus) {
             alert('success');
             },
         error: function (XMLHttpRequest, textStatus, errorThrown) {
	     alert('error');
             },
         complete : function(XMLHttpRequest, textStatus) {
	     alert('complete');
             }
         }
      );

Attachments

Change History

in reply to: ↑ description   Changed 3 months ago by Jeff

Adding " xhr.status == 404" fix the problem, don't forget to add it in future release ;-)

  Changed 3 months ago by Jeff

Oups sorry guys that still don't work ( forget to update some cache ), if i check the header on requested file that don't exist by using http://web-sniffer.net i have a nice and normal 302. If i display the xhr.status but adding alert('xhr status = '+xhr.status); inside Jquery a have this result :

FF xhr.status = 302 OPERA xhr.status = 0 IE xhr.status = 200 SAFARI = no display at all

.....

  Changed 3 months ago by Jeff

Method GET correct IE pb - Still don't work on Safari

  Changed 3 months ago by flesler

  • owner deleted
  • component changed from core to ajax
Note: See TracTickets for help on using tickets.