Geeks With Blogs

News


Rodney Vinyard - .NET & SQL Developer When all is said and done, more will be said than done
 Method 1:
 
1) In HTML Header, before HTML Body, hourglass cursor
 
  <script language="javascript"> 
   document.body.style.cursor = 'wait'
2) Add "Please Wait" Label (Visible = true)
 
   &nbsp; &nbsp; <asp:label id="lblPleaseWait" Text="Loading data, please wait..." ForeColor="Red" Visible="True" CssClass="labelCopy"
    Runat="server" Font-Size="Medium">...please wait...</asp:label>
 
3) At end of HTML Body, make label not visible, default cursor
 
  <script language="javascript"> 
    document.getElementById('lblPleaseWait').style.display="none";
              document.body.style.cursor = 'default'
  </script>
 </body> 
 
Method 2:
 
1) add div id="pleasewaitScreen" with
b. desired “please wait text”
 
        <div id="pleasewaitScreen" style="width:100%;text-align:center;visibility:visible">
        <font face="Arial" color="blue"><b>Loading graph, please wait...</b></font>
            </div>
 
2) In header section:
a. Add JavaScript function Check_Img()
                                            i.      At the right time
1. Sets visibility:hidden when right time
2. Sets wait cursor (houglass) back to default
b. and call function Check_Img()
 
<head runat="server">
    <title>Untitled Page</title>
            <script type="text/javascript" language="javascript">
            function Check_Img() {
                var imgTags = document.all.tags("IMG")
               
                //Then get count of tags
                var iImgTagCount = imgTags.length - 1
 
                //Loop through Collection
                document.body.style.cursor = 'wait'
                for (h=iImgTagCount; h > -1; h--)
                {
                    if (imgTags[h].complete)
                    {
                        clearInterval(img_timer)
                        document.body.style.cursor = 'default'
                        document.all.pleasewaitScreen.style.visibility="hidden";
                    }
                }
            }
 
            img_timer = setInterval('Check_Img()', 250)
 
            </script>
</head>
alternative example is sitting at
http://breakfastdinnertea.jottit.com/jsExample
Posted on Friday, September 14, 2007 12:55 AM javascript - ajax | Back to top


Comments on this post: On Web Page, until page loaded, display "Please Wait" with "hourglass/wait" mouse cursor

# re: On Web Page, until page loaded, display "Please Wait" with "hourglass/wait" mouse cursor
Requesting Gravatar...
document.all?!

you could at least TRY to make your code work in a browser that isn't IE. What's wrong with document.getElementById("pleasewaitScreen"); and document.getElementsByTag("img");?

And if the user doesn't have JS enabled he's never going to see your content. IE w/Javascript enabled is a relatively specific cross section of users (in terms of the shear number of users isolated).
Left by Simon on Sep 16, 2007 9:09 PM

# re: On Web Page, until page loaded, display "Please Wait" with "hourglass/wait" mouse cursor
Requesting Gravatar...
i need to chk
Left by snoopy on Oct 02, 2007 1:47 AM

Your comment:
 (will show your gravatar)


Copyright © Rodney Vinyard | Powered by: GeeksWithBlogs.net