I've read the FAQ about means of implementing a delay, but nothing
seems to work for me. My HTML page looks like this:
<html>
<head>
.... usual html stuff and then:
<script type="text/javascript">
function pause( milliseconds )
{
var date = new Date();
var curDate = null;
do
{ curDate = new Date(); }
while( curDate - date < milliseconds );
}
</script>
</head>
And then I do something like:
<body>
<p>
Now is the time
<script type="text/javascript">
pause( 5000 );
</script>
for all good men ...
</p>
</body>
</html>
My intention is to have "Now is the time" print followed by a 5-second
delay followed by "for all good men ..."
Sadly what actually happens is that the entire webpage delays for 5
seconds before loading and then "Now is the time for all good men ..."
prints as a unit. Can anyone tell me what I'm doing wrong before I go
insane? Many thanks for any and all help.