I have a script:
<script>
function load_thankyou()
{
alert('hii');
var delay = 1000; //Your delay in milliseconds
var URL = 'thankyou.php';
setTimeout(function()
{
window.location = URL;
}, delay);
}
</script>
The function is called in the following manner...
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
if($error_flag == 0)
{?>
<a class="close" href="#" onload="load_thankyou()">×</a>
<?php
}
}?>
But it seems, somehow the onload() function is not working..
See Question&Answers more detail:os