?
Solved

"please wait, page loading!"??

Posted on 1998-07-12
12
Medium Priority
?
583 Views
Last Modified: 2012-05-05
i have a heavy page, and while it takes its time to load, i want to display alt text like "please wait..." stuff
so how?
0
Comment
Question by:maish
[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
  • 6
  • 2
  • 2
  • +1
12 Comments
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 50 total points
ID: 1266468
in the page you load have

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
window.open("message.htm","msgwin","width=100,height=100");
</SCRIPT>
</HEAD>
<BODY>
big page
</BODY>
</HTML>

and in message.htm have

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
setTimeout('self.close()',10000);
</SCRIPT>
</HEAD>
<BODY>
Please wait, page loading...
</BODY>
</HTML>

it will stay open for 10 seconds and then disappear... change the 10000 to modifiy the length of time the please wait is open in miliseconds

Enjoy,
Michel

0
 

Author Comment

by:maish
ID: 1266469
hi michael,
yes thats one way to do it, but i dont want to open another window
cant i do it in the same window, like 'the introduction to dom' page at the www.projectcool.com website?
0
 
LVL 28

Expert Comment

by:sybe
ID: 1266470
The problem is that you can't remove text from a HTML document. So you'll haved to display the text some other way, an image, a form field...something you can change.

Display "please wait" in one of the ways mentioned.


make a function WriteContents () {
  document.write(".......write the contents of the page here...")
}

At the end of your page say

<script>
WriteContents()
</script>
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 28

Expert Comment

by:sybe
ID: 1266471
oh yes, and if you have images, then preload them in Javascript too.


0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1266472
I don't see why you don't wnat another window, it closes itself...

Anyway, here is a DHTML version
The following should work in MSIE4 and NS4 (but not give errors in the other browsers)

<HTML>
<HEAD>
<STYLE TYPE="text/css">
mtext {
    position: absolute;
    visibility: hidden;
}
-->
</STYLE>
<SCRIPT LANGUAGE="JavaScript">
<!-- // hide from non-js browsers
/* Script lifted from irt.org */
 if (document.layers) var doc = 'document.', vis = '.visibility';
 if (document.all)    var doc = 'document.all.', vis = '.style.visibility';
 function show(object) { if (document.layers || document.all) eval(doc + object + vis + ' = "visible"'); }
 function hide(object) { if (document.layers || document.all) eval(doc + object + vis + ' = "hidden"'); }
// unhide -->
</SCRIPT>
</HEAD>
<BODY>

<SCRIPT LANGUAGE="JavaScript">
<!-- // hide
if (document.layers || document.all) { // First we write the please wait in a layer
   document.write('<DIV ID="text1" CLASS="mtext">');
   document.write('<CENTER>');
   document.write('<TABLE><TR><TD BGCOLOR="#99CCCC"><FONT SIZE="+1"><B>Please wait</B></FONT></TD></TR></TABLE>');
   document.write('</CENTER>');
   document.write('</DIV>');

   show('text1') ; // Show the please wait
}
// -->
</SCRIPT>

big page

<SCRIPT LANGUAGE="JavaScript">
<!-- // hide
   if (document.layers || document.all) hide('text1'); // loose the please wait
// -->
</SCRIPT>
</BODY>
</HTML>

Enjoy,

Michel


0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1266473
Also a nice way is to use frames:

<FRAMESET ROWS="100%,*" ONLOAD="top.frames[0].location=top.frames[1].location.href">
<FRAME SRC="pleasewait.htm">
<FRAME SRC="bigpage.htm">
</FRAMESET>

that way the complete page is cached (if the cache is on) and the big page is swapped in when it finished loading

Michel
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1266474
Maish: I am a little disappointed that you give a D for not one, not two but three working examples on how to solve your problem...

Michel
0
 

Author Comment

by:maish
ID: 1266475
hi there michael,
sorry lah, i am new to this stuff...how did u get a D?
how does one  know?
i just clicked on accepted answer!!
so how does one do it?
sorry again
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1266476
Aha, I hoped that was the case...

When you have the screen with Here are your options:
At the top there is a row of radio buttons marked
A() excellent B() very good C() good D() acceptable

The points you decide that the question is worth will be multiplied by 4,3,2,1 depending on this grade (the points you give remain the same)

Since this is my first D and all the C's I get is from autograding (when people do not return to reject or accept an answer) I was curious to know why...

Michel

PS: If you REALLY want to change your grade, Customer support can probably help (it is onthe home page) hint, hint ;-)


0
 

Expert Comment

by:kouroshm
ID: 3651175
Only works in IE and not in NS
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 3724338
What only works in IE?

Michel
0
 

Expert Comment

by:kouroshm
ID: 3727402
The code works only in IE. did you check it in NS?
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
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…
Suggested Courses

762 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