Important alert: (current site time 7/15/2013 11:58:10 PM EDT)
 

VB icon

While the page is loading, a PLEASE WAIT message

Email
Submitted on: 9/25/2000 2:19:03 PM
By: PIAZZA Stephane 
Level: Beginner
User Rating: By 18 Users
Compatibility: HTML
Views: 104547
author picture
(About the author)
 
     Add those lines at the beginning of your page if there is a lot of pictures aso. While loading, a message will appear and will be hidden when the page will be fully loaded. Enjoy it ... And if u like it .... rate it .... Let's go to www.editeurjavascript.com to find a lot of javascript programs as this one.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
'**************************************
' Name: While the page is loading, a PLEASE WAIT message
' Description:Add those lines at the beginning of your page if there is a lot of pictures aso.
While loading, a message will appear and will be hidden when the page will be fully loaded.
Enjoy it ... And if u like it .... rate it ....
Let's go to www.editeurjavascript.com to find a lot of javascript programs as this one.
' By: PIAZZA Stephane
'
'This code is copyrighted and has' limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=6333&lngWId=4'for details.'**************************************

<BODY onLoad="cacheOff()">
<!-- BEGINNING OF THE SCRIPT -->
<STYLE TYPE="text/css">
<!-- 
#cache {
 position:absolute; left=10; top:10px; z-index:10; visibility:hidden;
}
-->
</STYLE>
<!--
Lines above are creating a layer which show a message
displaying the 'PLEASE WAIT ... ' message
-->
<SCRIPT LANGUAGE="JavaScript">
ver = navigator.appVersion.substring(0,1)
if (ver >= 4)
	{
	document.write('<DIV ID="cache"><TABLE WIDTH=400 BGCOLOR=#000000 BORDER=0 CELLPADDING=2 CELLSPACING=0><TR><TD ALIGN=center VALIGN=middle><TABLE WIDTH=100% BGCOLOR=#FFFFFF BORDER=0 CELLPADDING=0 CELLSPACING=0><TR><TD ALIGN=center VALIGN=middle><FONT FACE="Arial, Verdana" SIZE=4><B><BR>PLEASE WAIT ... <BR><BR></B></FONT></TD> </TR></TABLE></TD> </TR></TABLE></DIV>');
	var navi = (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 4);
	var HIDDEN = (navi) ? 'hide' : 'hidden';
	var VISIBLE = (navi) ? 'show' : 'visible';
	var cache = (navi) ? document.cache : document.all.cache.style;
	largeur = screen.width;
	cache.left = Math.round(100);
	cache.visibility = VISIBLE;
	}
function cacheOff()
	{
	if (ver >= 4)
		{
		cache.visibility = HIDDEN;
		}
	}
</SCRIPT>
<!--
When the page will be fully loaded, the message will be hidden
-->


Other 4 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
9/29/2000 12:18:27 AMeyekron

This is a pretty nice little tool... how would I center the window in the document area? ie not at position (10,10) but take the height of the document area div by 2 add the height of the table to get the top position... then do something of the same thing for the width... is this possible? if so how?
(If this comment was disrespectful, please report it.)

 
9/29/2000 3:06:34 AMChris

Humm.... It's great, but it's not ASP, and it's not your code !! Look at this url : http://www.editeurjavascript.com/scripts/scripts_autres_11.php. It's a really good french site. Sorry.... ;o)))
(If this comment was disrespectful, please report it.)

 
9/29/2000 2:35:35 PMJerry

Worked pretty well . . . in IE, but wouldn't unload in Netscape. Anybody else have the same experience?
(If this comment was disrespectful, please report it.)

 
9/29/2000 2:36:31 PMJerry

Worked pretty well . . . in IE, but wouldn't unload with Netscape. Anybody else experience the same thing?
(If this comment was disrespectful, please report it.)

 
9/9/2002 8:49:16 AM

great! worked a treat. i modified it salightly to make it appear in the centre of the screen, and display a small prgress bar GIF. to make it appear in the middle:

sWidth = screen.width;
sHeight = screen.height
cache.left = (sWidth / 2) - 200;
cache.top = (sHeight / 2) - 200;

with the height and width set correctly in the html. the progress bar is just a simple animated GIF that loops in an img tag

anyone know howe to make it appear in the middle of the current window?
(If this comment was disrespectful, please report it.)

 
9/11/2002 8:45:29 AM

i figured out how to do that:

sWidth = (navi) ? window.innerWidth : document.body.clientWidth;
sHeight = (navi) ? window.innerHeight : document.body.clientHeight;
cache.left = (sWidth / 2) - (theWidth / 2);
cache.top = (sHeight / 2) - (theHeight / 2);

it will appear in the middle of the current window
(If this comment was disrespectful, please report it.)

 
1/11/2003 9:41:24 PMFred.Cpp

Coool! And you can edit the code to add the text and borders you want! (Includes Images or animation!)
(If this comment was disrespectful, please report it.)

 
2/11/2003 3:37:20 PM

I have a .swf file and .mp3 file on my page. Is there anyway to make the page load fully, while not displayin/playing the page, then when everything's loaded play the sound and display the .swf???
(If this comment was disrespectful, please report it.)

 
8/6/2003 12:55:06 PM

extra ! just what I was looking for.
I am using RSS feed for my page and it it takes time to load.
Thanks !
(If this comment was disrespectful, please report it.)

 
6/4/2004 3:01:20 PM

I tried to appy for the page which uses Frames, but it does not work
can any one suggest me

thanks
(If this comment was disrespectful, please report it.)

 
11/13/2004 12:15:39 AM

I am a Realtor that must access the internet to use the multi-list services to list and sell houses. Netscape will not load either page correctly. I input my passwords on one and I get a partial menu for the page and then a
(If this comment was disrespectful, please report it.)

 
11/13/2004 12:18:34 AM

I get the message, "please wait..." when attempting to use the Oklahoma City Realtors multi-list service which is critcal for my job as a realtor. I never the menu items. On the Norman MLS, I get the menu list, but cannot select any options on the menus. Netscape simply does not work on my XP home machine. Why?
(If this comment was disrespectful, please report it.)

 
6/12/2006 9:35:10 PMsteven

Well, I am new in ASP and javascript, i past it to my html body but it didnt show the text. did i miss something?i am using IE browser.
(If this comment was disrespectful, please report it.)

 
8/28/2006 7:57:56 PMSudershan Thaiba


please help to display flash or gif or logo image while the page loads in place of "page loading" message
if anyone can please mail me at sushan1001@yahoo.com

(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.