I have stuck with really weird issue.
Here is code sample
$.ajax({
method: "POST",
data: content,
url: '/signin/',
success: function (response) {
window.location.href = 'test.html';
},
error: function (xhr, status, err) {
errorHandler(xhr);
}
});
First I thought redirection works only after opening debugger, and searched in that direction.
According to results and threads I commented all console.log
statements. No luck.
Then found that only redirection is not working.
Then I tried
window.location.replace("test.html");
,
window.location.assign("test.html");
,
window.location.href = test.html
,
window.open('test.html','_self', null , false);
,
setTimeout('window.navigate("test.html");', 1);
still no luck..
Now I figured out when I open debugger and clear browser's cache and close the debugger again, then redirection works only once not after that.
To get redirection work I have to either clear the browser's cache everytime or have to keep debugger open.
How do I get redirection work without opening developer tool?
I Appreciate the help.
Thanks.