logo image

how to redirect to a url using Javascript


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

1 Answer

2 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;
2 years ago by Megamind