For example: Or, as an alternative, we could also use an inline onload event on the body tag like so: In this case, however, you must note that everything that preceedes the body tag will be parsed by the browser first. . The window.location object can be written without the window prefix. // 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 ».
. In Javascript, you can use many methods to redirect a web page to another one. It takes time delay of 3 secondsto take to the mentioned URL page.