Javascript "Please Wait" Message Boxes
page 4 of 5
by Joe McLaughlin
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 48673/ 438

Step 3 - Fix Script By Splitting It Up

The way around this is to split up the JavaScript code. The first function do_totals1() will show the DIV area and then call the setTimeout function. This function will start a timer that will execute the function passed as the first parameter after a number of miliseconds specified in the second parameter. In this case, do_totals2() will be called after one milisecond. How does this help us? When do_totals1() completes, but before do_totals2() begins, the browser will perform a refresh and display our "Please Wait" message.

<script language="Javascript">
function do_totals1()
 {
 document.all.pleasewaitScreen.style.visibility="visible";
 window.setTimeout('do_totals2()',1)
 }
 
function do_totals2()
 {
 calc_totals();
 document.all.pleasewaitScreen.style.visibility="hidden";
 } 
<script>

 


View Entire Article

Article Feedback

Title:  
Name:  
Url: ( Optional )
Comment:  
Please add 3 and 7 and type the answer here:

User Comments

Title: Test   
Name: Testing Homer
Date: 11/26/2007 2:57:25 PM
Comment:
This is just a test
Title: hjhg   
Name: jghdj
Date: 10/2/2007 4:48:28 PM
Comment:
jdghjdghj
Title: offset the div from top of page window   
Name: JF
Date: 9/6/2007 5:32:52 PM
Comment:
Regarding this line of code under "finishing touches":

document.all.pleasewaitScreen.style.pixelTop = (document.body.scrollTop + 50)

First, I think the line is missing the final ";". Second "pixelTop" is not a property defined in CSS. Use "top" instead. Third, document.body.scrollTop may return zero - use "document.documentElement.scrollTop" instead. Finally, if you defined the div style using something like .... top: 250px; then you will need to add "+ 'px'" to the end. So we now have:

document.all.pleasewaitScreen.style.top = (document.documentElement.scrollTop + 50) + 'px';
Title: Hurry   
Name: Jagjit
Date: 8/2/2007 10:15:31 AM
Comment:
Yes, this was my requirement and i got it. Thanks a lot ASPalliance for it.
Title: Very good   
Name: Miriam
Date: 7/25/2007 3:26:39 PM
Comment:
Thank you. This was helpful for a newbie. I modified it to use the display:block and display:none and it worked fine. I have the function called by an onClick of the submit button.
Title: Easiest way to display Please Wait Screen   
Name: dng
Date: 6/1/2007 1:25:18 PM
Comment:
Hi,

This is a good article, but to display the Please wait message in easiest way, you will find this link useful http://dotnetguts.blogspot.com/2007/02/please-wait-screen-for-heavy-loading_12.html


Keep going good work
Dotnetguts (DNG)
http://dotnetguts.blogspot.com
Title: please wait signal   
Name: baba
Date: 3/22/2007 3:03:47 AM
Comment:
excelllent
Title: Hmmm....   
Name: Dave
Date: 2/20/2007 9:24:39 PM
Comment:
Niiiiiiiiiiiiiiiiiiiiiiiiiice.... I've been lookin' for this for ages!!!! Like Steve-O said, display:none; would work better than visibility: hidden;
Title: We can give Please wait msg using Ajax   
Name: Sandesh
Date: 1/10/2007 2:42:11 AM
Comment:
we can give please wait msg using ajax

how?

Ans:-
when we are requesting some thing using ajax then there are 'readystate' as 0,1,2,3,4 4 is a last state where all data is recieved so show that div while readystate is not 4
Title: boo   
Name: boo
Date: 10/3/2006 7:49:55 AM
Comment:
I want this thing to work with AJAX
where I hav a div in which I m calling another page by AJAX
so can any one tell me how to give Please wait msg in that div before the page inside that div is completely loaded
Title: Ya this is a good solution but I m lookin for something else   
Name: Abhishek
Date: 8/10/2006 2:19:03 AM
Comment:
Actually I want this thing to work with AJAX
where I hav a div in which I m calling another page by AJAX
so can any one tell me how to give Please wait msg in that div before the page inside that div is completely loaded

Thanks
Abhishek
Title: Simple and Good   
Name: Dinesh
Date: 6/6/2006 7:22:54 AM
Comment:
This is Simple one using only javascript
Title: good   
Name: indra
Date: 5/11/2006 6:43:07 AM
Comment:
thankful to you
Title: Good Show   
Name: Naresh Kumar Ravuri
Date: 3/7/2006 4:13:12 AM
Comment:
God show and keep it up
Title: ya   
Name: kiran
Date: 2/22/2006 12:05:39 PM
Comment:
yeah i actually want the jscript to use in the dotnet
Title: exactly what i wanted   
Name: Pamita Rao
Date: 2/8/2006 12:49:28 AM
Comment:
thanks a lot
Title: ROCK   
Name: ROCK
Date: 12/26/2005 6:40:30 AM
Comment:
Not much good.Need to improve
Title: Just i was needed   
Name: Gurudatt Kumar
Date: 9/13/2005 3:29:03 PM
Comment:
Yes, this was my requirement and i got it. Thanks a lot ASPalliance for it.
Title: Very good   
Name: Davidka Bujolastanna
Date: 8/17/2005 5:01:19 PM
Comment:
Your example brought me great pleasure!
Title: Great Job!   
Name: Steve
Date: 7/22/2005 11:39:58 AM
Comment:
Good work explaining. I learned somthing new.
Title: Nice   
Name: Steve-O
Date: 6/21/2005 5:06:44 PM
Comment:
Thanks. Your div works great! The only suggestion I have is to use the display:block and display:none instead of visibility. It works on more browsers.
Title: checking   
Name: ram
Date: 6/20/2005 6:02:43 AM
Comment:
Checking the Please Wait Future
Title: Some   
Name: Unni
Date: 6/16/2005 3:05:59 AM
Comment:
GOOD
Title: Just what I've been looking for!!   
Name: Charn
Date: 2/22/2005 3:46:16 AM
Comment:
Many thanks Josept.

Product Spotlight
Product Spotlight 
Learn More
.NET Tools
asp.net shopping cart
asp.net chart control






Ads Powered by Lake Quincy Media
Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2008 ASPAlliance.com  |  Page Processed at 7/5/2008 4:09:15 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search