how to redirect to a url using Javascript


How can i redirect from a page to another page programatically using Javascript?

1 Answer

7 years ago by

Using the following javascript code, you can redirect to a new page from any page

var newUrl = 'https://example.com/more'
window.location.href = newUrl;
7 years ago by Karthik Divi