Ambiguous behavior among Firefox and Chrome. Here is my ajax call:
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: "text",
url: "client",
data: "{\"operationType\": \"Update\", \"body\": \"" + JSON.stringify(formAsJson).replace(/\"/g, "'") + "\"}",
async: false,
})
.done(function() {
window.location.replace("success.html");
alert("Success");
})
.fail(function() {
alert("failure");
});
Question 1 : If alert("Success") is present, then redirection works fine in Firefox and in Chrome redirection doesn't happen but alert is shown. Explanation for this behavior.
Question 2 : How to redirect to a page independent of browser ?
If I comment alert("Success") in done callback, the redirection doesn't work in mozilla but while debugging using firebug, it works.
On chrome it doesn't work anyway with or without debugger.
P.S. Checked that control goes to redirection statement in both browser using debugger.