How do I redirect to another webpage?
Explanation
Redirect to another webpage we need.
jQuery is not that necessary, and redirecting window.location.replace(...)
will best simulate an HTTP.
window.location.replace(...)
is better than using window.location.href.
The reason behind that is replace()
does not keep the originating page in the session history. Also means the user won’t get stuck in a never-ending back-button fiasco.
And in case one wants to simulate someone by clicking on a link, at that time use location.href
By using location.replace
one simulates an HTTP redirect.
For example:
// similar behavior as an HTTP redirect
window.location.replace("http://studyexperts.in");
// similar behavior as clicking on a link
window.location.href = "http://studyexperts.in";
This is how someone can redirect to another webpage
Also read, In noncat table, change the category for item UF39 to null