Welcome to WebmasterWorld Guest from 54.163.40.152

Forum Moderators: incrediBILL

Message Too Old, No Replies

Need a considerable delay on page load of HTML Page

Need a Delay on HTML page load

     

ssriram

11:11 am on Aug 17, 2006 (gmt 0)

5+ Year Member



Hi

Iam having a simple HTML page, i want to make the page load after a considerable delay (5 or 10 seconds).

(The html page should be loaded after the given delay period)

Thanks in Advance

dareRock

1:44 pm on Aug 17, 2006 (gmt 0)

5+ Year Member



you could use a php call before any of the first opening html tag (or declaration)

[2]
<?php
sleep(10);
?>
[/2]

where '10' is 10 seconds.

Although you would have to change your page to .php from .html - a workaround is, if your server supports SSI (apache does), the you can have the 'sleep' code in an external file and then call it in...

that may work for you

LifeinAsia

3:33 pm on Aug 17, 2006 (gmt 0)

WebmasterWorld Administrator lifeinasia is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



Just curious- why would you WANT to make a delay for your users?

ssriram

4:45 am on Aug 22, 2006 (gmt 0)

5+ Year Member



Hi

Thanks for your replies. but i dont want to make it a php page. It should be a HTML page only. I want to test one functionality of our application, so i need this time delay in page load.

penders

4:14 pm on Aug 25, 2006 (gmt 0)

WebmasterWorld Senior Member penders is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



I don't see how, by adding any client-side JavaScript or whizzy HTML to the page itself, you can actually delay a page from loading, since for the client-side JavaScript to execute, the page will have had to have already loaded! To actually delay a page from loading, ie. delay it from being sent from the server to the client would require something server-side, like the PHP sleep mentioned above - I recon.

However, you could make it look like there is a delay in the page loading (although I don't think this would satisfactorily test your application)... In the link to your page you are wanting to delay, you could instead call some JavaScript that waits a few seconds (setTimeout) before actually making the request for the new page. Or you could perhaps hide everything on the page with CSS and once the page has loaded (onload) and you've waited a few seconds, make everything visible to the user!?

Hhhhmmmm...

stajer

4:26 pm on Aug 25, 2006 (gmt 0)

10+ Year Member



You can do a redirect with a delay.

On page 1 put:

<meta name="refresh" content="10;page2.html">

<p>Please wait...</p>

Then page2.html will load after 10 seconds.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month