Reputation: 1
<script>
function moveon() {
//display a modal dialog to ask the user question
var answer = confirm("Ready to move on? ");
// If they clicked the "ok" button, make the browser load a new page.
if (answer)
window.location = "http://google.com";
}
//run the function defined above 1 minute (60,000 milliseconds) from now
setTimeout(moveon, 60000);
</script>
I'm wondering why this code fragment failed to execute in my html file even though it is straight from javascript definitive guide.
i'm a mac user so haven't had a chance to test on pc.
Upvotes: 0
Views: 294