473,387 Members | 1,517 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

need help on displaying Loading Please Wait Message page

31
Hi,
The problem is that I want to display a Loading Please Wait Message page when a page is trying to load. This all needs to be done when I click on a submit button.
Mar 16 '07 #1
6 8505
acoder
16,027 Expert Mod 8TB
Welcome to TSDN.

Do you want to display as soon as the page request is made? I doubt this is possible using Javascript. One possibility is to use Ajax in which case, you can easily display a div with that message. Another possibility is to flush content using your server-side language (if it has that capability).
Mar 16 '07 #2
Nelluru
31
Welcome to TSDN.

Do you want to display as soon as the page request is made? I doubt this is possible using Javascript. One possibility is to use Ajax in which case, you can easily display a div with that message. Another possibility is to flush content using your server-side language (if it has that capability).

Actually i want to download a file which the file asks for the IP address page will be displayed asking for the ipaddress
My page asks for IpAddress to download a file and burn that file into the ROM. After entering the IpAddress i will click on a submit button. The time taken to download and burning varies. While this is happening I want to display a message to the user saying that to Loading - please wait.......
both the things should start at the same time. If i dont display the message then there will be a lot of confusion to the user.
will this be possible????????
Mar 16 '07 #3
iam_clint
1,208 Expert 1GB
Acoder i have done the impossible :P I had already created a please wait while the next page loads directly after submit and it wait till the next page is loading with animated gif and text saying please wait. please wait.. please wait...please wait....you get the idea

and heres how it works
Expand|Select|Wrap|Line Numbers
  1. <script>
  2. function pwait(count, co, color) {
  3. if (count == 1) { document.getElementById("pwimg").src = "images/pwait.gif"; }
  4. //border-top: solid 2px black; border-bottom: solid 2px black; border-right: solid 2px black; border-left: solid 2px black;
  5. var ftable = document.getElementById("pwtable");
  6. if (co == 1) {
  7. ftable.style.borderTop = "solid 2px "+color;
  8. ftable.style.borderBottom = "solid 2px black";
  9. ftable.style.borderLeft = "solid 2px black";
  10. ftable.style.borderRight = "solid 2px black";
  11. }
  12. if (co == 2) {
  13. ftable.style.borderTop = "solid 2px black";
  14. ftable.style.borderBottom = "solid 2px black";
  15. ftable.style.borderLeft = "solid 2px "+color;
  16. ftable.style.borderRight = "solid 2px black";
  17. }
  18. if (co == 3) {
  19. ftable.style.borderTop = "solid 2px black";
  20. ftable.style.borderBottom = "solid 2px "+color;
  21. ftable.style.borderLeft = "solid 2px black";
  22. ftable.style.borderRight = "solid 2px black";
  23. }
  24. if (co == 4) { 
  25. ftable.style.borderTop = "solid 2px black";
  26. ftable.style.borderBottom = "solid 2px black";
  27. ftable.style.borderLeft = "solid 2px black";
  28. ftable.style.borderRight = "solid 2px "+color;
  29. co = 0; 
  30. }
  31. document.getElementById("pleasewait").style.visibility = "visible";
  32. document.getElementById("pwaitblur").style.visibility = "visible";
  33. var vtop = document.body.offsetHeight/2;
  34. var vleft = document.body.offsetWidth/2;
  35.     document.getElementById("pleasewait").style.top = document.body.scrollTop+document.documentElement.scrollTop+vtop-80;
  36.     document.getElementById("pleasewait").style.left = document.body.scrollLeft+document.documentElement.scrollLeft+vleft-80;
  37. document.getElementById("pwaitblur").style.left = document.body.scrollLeft+document.documentElement.scrollLeft;
  38. document.getElementById("pwaitblur").style.top = document.body.scrollTop+document.documentElement.scrollTop;
  39. tmp = document.getElementById("pwait").innerHTML;
  40. if (tmp == "&nbsp;") {
  41. document.getElementById("pwait").innerHTML = ".";
  42. }
  43. if (tmp == ".") {
  44. document.getElementById("pwait").innerHTML = "..";
  45. }
  46. if (tmp == "..") {
  47. document.getElementById("pwait").innerHTML = "...";
  48. }
  49. if (tmp == "...") {
  50. document.getElementById("pwait").innerHTML = "&nbsp;";
  51. }
  52. co = co + 1;
  53. count = count + 1;
  54. var pwaitint = window.setTimeout("pwait("+count+", "+co+", '"+color+"')", 200);
  55. </script>
  56.  
The Divs
[HTML]
<div id="pwaitblur" style="position: absolute; width: 100%; height: 100%; top: 0; left: 0; opacity: 0.5; -moz-opacity: 0.5; -khtml-opacity: 0.5; filter: alpha(opacity=50); visibility: hidden; background: black;"></div>
<div id="pleasewait" style="position: absolute; top: 50%; left: 50%; width: 200; height: 60; visibility: hidden;"><table width="100%" height="100%" bgcolor="white" style="border-top: solid 2px black; border-bottom: solid 2px black; border-right: solid 2px black; border-left: solid 2px black;" id="pwtable"><tr><td><img src="/images/pwait.gif" id="pwimg"><td width="70%" align="right" style="font-weight: 800;">Please Wait<td id="pwait" width="30%" align="left" style="font-weight: 800;">&nbsp;</table></div>
[/HTML]
The style
[HTML]
<style>
html,body{ margin:0; padding:0; height:100%; border:none }
</style>
[/HTML]
The onclick event
[HTML]
onclick="pwait(0, 1, 'black');"
[/HTML]

The timeout in the code makes all the difference.

You may copy - paste my code :) good luck and let us see the final result please
Mar 16 '07 #4
chunk1978
224 100+
is is possible to use this code on the same page which it rests? i have a 200KB+ javascript/html document, and it takes a bit to load... i'd like to display something like this "please wait" while the page loads... i'm just concerned where to place this...
Mar 17 '07 #5
iam_clint
1,208 Expert 1GB
yes you need to place it on the page before the page that you submit to
Mar 17 '07 #6
chunk1978
224 100+
yes you need to place it on the page before the page that you submit to
humm... i'm actually linking my 200+KB javascript/form from a Flash document... not sure sure this javascript will work as actionscript... is it possible to change the onClick event to a body onLoad event?... i'm thinking i could link to a preloader page from the actionscript (with an onLoad event) which would then load the 200+kb javascript/form page?
Mar 18 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: deepblue | last post by:
Hi, I need to display a "please wait" message when the user click a post button on a webform, so that the webform can start data processing. I am using asp.net in vb.net code- behind. I saw some...
4
by: MFA | last post by:
Hi All I have one ASP page. During opening this page its taking some time to open as its has to process some asp code. I want to display some animated gif or text showing that page is loading...
4
by: Jason . | last post by:
I have seen a few articles with a javascript example but it is not working for me. The server side code is processed first and then the javascript so I basically get my page loading splash screen...
3
by: Naomi | last post by:
hello Could anyone please tell me if there is any way i can have the text "Menu Loading Please Wait..." appear while the js menu loads and then disappear after it loads ? hoping to hear some...
1
by: metsymani | last post by:
In my web application, I have a search screen coded in ASP.Net. The Search process takes lot of time. So, I need to show a wait page informing the user that "Search is in progress. Please wait" along...
0
by: s_erez | last post by:
Hi, This is a realy tricky one. I have an ASP.NET application where some pages are reading data from a DB and presenting reports. In order for the user to wait while the page is reading data from...
4
by: dave | last post by:
Hi guys I display one page in popup window...that fetches some data from sql and perfom some calculation (tht approx 10 secs) and display result.... I am trying to display "Please wait ..."message...
0
by: Hari Kumar G | last post by:
Experts! We are experiencing the following difficulty. We are required to display a gif image as a "please wait message", as done in asp pages. When this is attempted in an asp.net post...
2
by: A.M | last post by:
Hi, I have a DataGrid report and filling that DataGrid takes time. How can I show a friendly "Please Wait ..." message during processing and hide it when I am showing the actual DataGrid? Could...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.