homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

Need a considerable delay on page load of HTML Page
Need a Delay on HTML page load

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


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



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

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


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


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

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


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


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.


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

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!?



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

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.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved