Solved

Please wait... JavaScript

Posted on 2002-03-12
9
677 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
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
 
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now