Pre-Loading Message | JavaScriptSource

Pre-Loading Message

Robert Paulson May 25, 2005

General

Use this script to warn your visitors that your page is loading. Short but effective.


Notes

Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: preLoadingMessage.js


CSS

Paste this code into your external CSS file or in the <style> section within the HEAD section of your HTML document.


Head

Paste this code into the HEAD section of your HTML document.


Leave a Response

(27 comments)

I would set the body tag to style="display:none;", and give it an id, like id="pageBody" and then at the bottom, under document.getElementById("loading").style.display="none";[br /]add[br /]document.getElementById("pageBody").style.display="";[br /]and that will make the whole body visible at once.

Joe Tricarico Nov 8, 2008

Your question is beyond the scope of these comments. You will need to post it over on [a href="http://www.webdeveloper.com/forum/forumdisplay.php?f=3"]the JavaScript forum[/a]. Thanks!

Lee Oct 31, 2008

Thanks so very much for this simple but precise script. After dealing with tons of weirdness of the old &#39;onload&#39; that firefox killed, my final attempt to make a page-loader was to browse the JavaScript online sources. What a lifesaver.[br /][br /]Plus I was able to easily add a fade out with jQuery!

ISOSCELES Sep 7, 2008

The script is short and effective.[br /]and simple to use in a site, it works fine.[br /]thanks

Hein Kuiper Sep 4, 2008

Thank you very very much. I was lookin for something like it for a while.

Anshul Singla Jun 30, 2008