Skip to main content

Bug Tracker

Side navigation

#6062 closed bug (invalid)

Opened February 09, 2010 04:03PM UTC

Closed October 09, 2010 04:14AM UTC

Ajax call which retrieves a 301 status does not return this in the error callback

Reported by: daanoz Owned by:
Priority: undecided Milestone: 1.4.2
Component: ajax Version: 1.4.1
Keywords: Cc:
Blocked by: Blocking:
Description

$.ajax({

type: "POST",

url: formpost.php,

error: function(response, textStatus, errorThrown) {

alert(response.status);

}

});

if formpost.php has a redirect (301 header) on correct formsubmission, the ajax call, calls the error event. This is correct, but the status that is return is "0" instead of "301"

Attachments (0)
Change History (1)

Changed October 09, 2010 04:14AM UTC by snover comment:1

priority: → undecided
resolution: → invalid
status: newclosed

Thanks for the report, but this is not a bug. If status code is zero, that means you are trying to redirect to a location that violates the same-origin policy. XMLHttpRequest will always follow redirects and return the status code of the final page.