How TO - Redirect to Another Webpage Using Pure JavaScript Source :- https://www.w3schools.com/howto/howto_js_redirect_webpage.asp Learn how to redirect to another webpage using JavaScript. Redirect a Webpage There are a couple of ways to redirect to another webpage with JavaScript. The most popular ones are location.href and location.replace : Example // Simulate a mouse click: window. location . href = "http://www.w3schools.com" ; // Simulate an HTTP redirect: window. location . replace ( "http://www.w3schools.com" ); Try it Yourself » Note: The difference between href and replace, is that replace() removes the URL of the current document from the document history, meaning that it is not possible to use the "back" button to navigate back to the original document.
At CXDIIN, we are passionate about technology, programming, and exploring the vast world of JavaScript libraries. Our mission is to provide valuable resources, tips, and tricks to empower individuals and help them navigate the ever-evolving landscape of technology.