Redirection means that when an HTTP request for one page automatically goes to another page. Usually redirection of a web page is used for redirecting to a different domain for example when we move our weebsite from one URL to another URL or version change of a web page.
Option 1: Web Page Redirection using replace() function:
replace() function of window.location object removes the current web page(URL) from the history and replaces it with the new web page (URL). In this method user unable to use the browser back button to navigate previous page.
window.location.replace("new web page_url")
Option 2: Using window.location.href:
If we want to redirect the URL when the user click on the button elements, we will use 'window.location.href' for redirection.
window.location.href("new web page_url").
Option 3: Using window assign() function:
window.location.assign("new web page_url").
Option 4: Using navigate function:
navigate function is the same as window.location="url" but it loads the web page from the cache rather directly request from the server.
Option 5: Redirect web page using JQuery
var url = "https://www.thelinuxfaq.com/";