DelphiFAQ Home Search:
General :: Web publishing :: JavaScript
Code snippets to add functionality to your HTML pages, preferably cross-browser.


This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.

Featured Article

Show an HTML message box that disappears after 2 seconds


I need to show an HTML message box that disappears after 2 seconds.
It does not need to be a popup window.


Simply display a centered HTML table with a button that says 'please click'.
You can also do an automatic redirect after 3 seconds as shown below.
The sample code uses the setTimeout() function which will call the redirecting javascript function after 3000 milliseconds.

 <table border=4 cellspacing=0 cellpadding=20>
 <tr><td bgcolor=silver align=center>
 <p>The configuration is being updated.</p>
 <form id=frm1 name=frm1 action="main.cgi" method=post>
 <input type=hidden name=action value="detail">
 <input type=submit id=btnSubmit name=btnSubmit value="Please click to continue or wait 3 seconds" class=input>
 <script type=text/javascript language="JavaScript">
 function countdown() {
 setTimeout("countdown()", 3000);

Generated 4:01:38 on Jan 21, 2020