Redirect a url using javascript

We can use window.location.replace(…) or window.location.href to redirect a url using javascript.

//Behave as an HTTP redirect
window.location.replace("https://www.w3schools.blog");

//Behave as clicking on a link
window.location.href = "https://www.w3schools.blog";

Related topics:

Content Protection by DMCA.com
Please Share