I am working with an older system using jQuery 1.2.6. I am sending an AJAX request through a function jQuery.ajax. The URL that he clicks sends a 302 HTTP Redirect response and ultimately receives a 200 HTTP OK response. I registered a callback successand complete, but none of them are called.
My question is: are there any callbacks that can / will be called after the redirect?
jQuery.ajax({
type: "GET",
url: url,
data: null,
dataType: "json",
async: false,
success: function(data, textStatus) {
alert("SUCCESS CALLED: " + textStatus);
},
complete: function(xhr, status) {
alert("COMPLETE CALLED");
}
});
NOTE. The answer is HTML, not JSON, however changing dataTypeto htmlchanges the request. It sends a request OPTIONSinstead of a request GET, and it also no longer redirects. I need these redirects.
source