Solved

Please wait... JavaScript

Posted on 2002-03-12
9
682 Views
Last Modified: 2012-08-14
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
Comment
Question by:peddhapati
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 6858923
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
 
LVL 1

Accepted Solution

by:
adowns earned 100 total points
ID: 6858949
This may be very much of interest to you!

http://www.webtechniques.com/archives/1998/04/junk/
0
 
LVL 3

Expert Comment

by:nzjonboy
ID: 6859350
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
Independent Software Vendors: 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!

 
LVL 30

Expert Comment

by:third
ID: 6859409
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
 
LVL 23

Expert Comment

by:b1xml2
ID: 6859688
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
 
LVL 12

Expert Comment

by:ahosang
ID: 8076275
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
 
LVL 12

Expert Comment

by:ahosang
ID: 8234597
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
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 8234642
I recommend a split among adowns,  third, and  b1xml2. They put effort into the question and contributed meaningful content.

Fritz the Blank
0
 

Expert Comment

by:SpideyMod
ID: 8303670
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

Technology Partners: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question