Go to URL after OK button if alert is pressed

Ondrej picture Ondrej · Feb 22, 2012 · Viewed 227.6k times · Source

I need to make sure that when the user clicks OK in a JavaScript alert window, the browser moves to a different URL. Is this possible?

Answer

penartur picture penartur · Feb 22, 2012

What do you mean by "make sure"?

alert('message');
window.location = '/some/url';

redirects user after they click OK in the alert window.