I'm using a callback from an AJAX post request to navigate to a new page, but it is not working on Internet Explorer. My code is as follows:
$.ajax({
type: "POST",
url: phpUrl,
data: data,
async: false,
success: function() {
if (navigator.appName == 'Microsoft Internet Explorer'){ window.location.href("/step2.php")}
else{ window.location.href = "/step2.php"}
},
dataType:'json'
});
This works fine on FF/Safari/Chrome but when I test it on IE it does not work. Is there a better way of redirecting to a new page? I'm using async:false
as my data was not loading on Chrome/Safari if I did not use a callback as the page would just change before the POST
request was complete.
location.assign("/step2.php");
is not working on IE either, but does work on FF/Safari/Chrome. My original attempt at using it as a function was based on the documentation that I read (that @Hexxagonal referred to also). – Dauphin