Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 710
  • Last Modified:

Please wait... JavaScript

Hi
  I would like to have a JavaScript that would open a intermediate window saying "Please Wait..." while loading the new window.

Note:
1. The solution has to work in both IE and Netscape
2. The requested window should remain in the background while you were able to see the small pop up window with this message.
3. Once the new window is loaded completly it should replace the old window and the poped up window should disappear.

Also, I would like to have the code in the source page or in a differnt file which is called from the source page.   Since I have no control over the links from the source page.

Thanks
0
peddhapati
Asked:
peddhapati
1 Solution
 
fritz_the_blankCommented:
You could launch a pop-up window on the onLoad event, but I don't know of any event that triggers when the page finishes loading. Moreover, I think that the onLoad event fires only once the page has finished rendering. Alternatively, if you have a sense of how long the page takes, you could launch a window saying telling the user to wait and launch the main window in the background, but then you wouldn't really be able to close the first window because it would be considered as the parent window. I wonder if there might be some way to use the setTimeOut function to accomplish something like you're looking for...

http://developer.irt.org/script/timeout.htm

Fritz the Blank
0
 
adownsCommented:
This may be very much of interest to you!

http://www.webtechniques.com/archives/1998/04/junk/
0
 
nzjonboyCommented:
almost what you want here http://www.dhtmlcentral.com/script/script.asp?id=17 only it doesn't display in a popup window, instead hides the content of the page until it is ready to display

nzjonboy
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
thirdCommented:
try this,

<div id=loadingmsg style="position:absolute; z-index:2; left:300; top:150; width:200; height:100; border-width:4; border-style:ridge; background-color:#eeeeee"><center><br><br><font face='Arial' Size=3><b>Please Wait.....</b></font><br><br></center></div>
<html>
<head>
<script>
  function hidemsg(){
    if (document.all)
      document.all.loadingmsg.style.visibility='hidden';
    if (document.layers)
      document.loadingmsg.visibility='hidden';
    if (document.getElementById)
      document.getElementById('loadingmsg').style.visibility='hidden';
  }
</script>
</head>
<body onload="setTimeout('hidemsg()',1000);">
  <P> welcome to this page </P>
</body>
</html>

the message will disappear one second after loading the page.
0
 
b1xml2Commented:
MSIE only
=========
load.html
=========
<script language="javascript">
wSplash = window.open("splash.html","splash","height=100px,width=200px,center=1");
if (wSplash.opener == null) wSplash.opener = window;

//MSIE only
document.onreadystatechange = checkit;
function checkit() {
     if (document.readyState == "complete") { wSplash.close(); wSplash = null; }
}

</script>
<html>
<head>
<title>Waiting</title>
</head>
<body style="margin:0px;" scroll="no">
<iframe src="http://www.cisco.com" height="100%" width="100%" frameborder="0" marginheight="0" marginwidth="0"></iframe>
</body>
</html>


splash.html
===========
<html>
<head>
<title>Splash Window</title>
</head>
<body style="text-align:center;font-family:Tahoma;font-size:10pt;">
<div>Loading...</div>
</body>
</html>
0
 
ahosangCommented:
This question has been abandoned. I will make a recommendation to the moderators on its resolution in a week or so. I appreciate any comments that would help me to make a recommendation.
 
In the absence of responses, I may recommend DELETE unless it is clear to me that it has value as a PAQ. Silence = you don't care
 
ahosang
0
 
ahosangCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

PAQ - NO REFUND
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
ahosang
EE Cleanup Volunteer
0
 
fritz_the_blankCommented:
I recommend a split among adowns,  third, and  b1xml2. They put effort into the question and contributed meaningful content.

Fritz the Blank
0
 
SpideyModCommented:
Points split:

SpideyMod
Community Support Moderator @Experts Exchange

third, points for you at
http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_20580413.html

b1xml2, points for you at
http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_20580412.html
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now