jjujuma jjujuma - 5 months ago 14x
Javascript Question

How to get browser to navigate to URL in Javascript?

What is the best (correct, modern, cross-browser, safe) way to get a web browser to navigate to a URL of your choice using Javascript?


This works in all browsers:

window.location.href = '...';

If you wanted to change the page without it reflecting in the browser back history, you can do: