I'm trying to make a script that keeps a user on a webpage for "x" amount of time, before redirecting them back to our start page. As it stands right now, I have it so the dialog box pops open and stays there until the time runs out, clicking on the "ok" button only pops up the dialog box again. What I'm trying to do is make it so the "Ok" button only appears after the time runs out. I'm not even sure this can be done, but any help people can give me would be greatly appreciated.
Here's the code I have right now...
<html>
<head>
<title>Redirectz0r</title>
<script langauge="JavaScript">
<!-- hide me
function announceTime()
{
//get the date, the hour, minutes, and seconds
var the_date = new Date();
var the_hour = the_date.getHours();
var the_minute = the_date.getMinutes();
var the_second = the_date.getSeconds();
var done = the_second + 15;
//put together the string and alert with it
var the_time = the_hour + ":" + the_minute + ":" + the_second;
//alert("The time is now: " + the_time);
//alert(the_second);
for(var i = the_second; i <= done; i++) {
alert("You must wait, you bastard!");
}
location.href="}
// show me -->
</script>
</head>
<body onLoad="announceTime();">
...
</body>
</html>
Here's the code I have right now...
<html>
<head>
<title>Redirectz0r</title>
<script langauge="JavaScript">
<!-- hide me
function announceTime()
{
//get the date, the hour, minutes, and seconds
var the_date = new Date();
var the_hour = the_date.getHours();
var the_minute = the_date.getMinutes();
var the_second = the_date.getSeconds();
var done = the_second + 15;
//put together the string and alert with it
var the_time = the_hour + ":" + the_minute + ":" + the_second;
//alert("The time is now: " + the_time);
//alert(the_second);
for(var i = the_second; i <= done; i++) {
alert("You must wait, you bastard!");
}
location.href="}
// show me -->
</script>
</head>
<body onLoad="announceTime();">
...
</body>
</html>