// The behavior of this method would be as HTTP redirect
// The behavior of this would be as clicking on a link
window.location.href = "http://code.askemin.com";
//Navigate to the Location.reload article
All the three code does the same job. It would redirect to the URL, however, the Location.replace() method replaces the current resource with the one at the provided URL. The difference from the assign() method is that after using replace() the current page will not be saved in session History, meaning the user won’t be able to use the back button to navigate to it.
Redirect Page using Jquery
There are multiple ways of redirecting to a page in Jquery. Let us take a look of each one.
Example using Jquery:
If you are using Jquery to redirect to a page then you could use one of the above code for redirection.