So, if a have a Javascript function such as
function doSomething() {
alert("Starting...");
window.location = "http://www.example.com";
alert("Completed.");
}
Why does the last line not work? I’m almost sure it’s a security issue, but maybe I’m doing something wrong.
Thanks in advance.
Pretty sure it’s just because you have left the page and the browser doesn’t run javascript from pages not displayed.
To do this you’d probably need to use frames or else load the new page in an iFrame or equivalent.