Please wait.... message before the page load

Does anyone know how to show a "please wait..." message until the page load was finished?

I have an image button on a page called 'Take Test'. But loading of test page takes some time. So I want to show "Please wait loading" text above the image button.

Thanks in advance.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

here is something I found from Google, it seems to do what you want.

anandnerkarAuthor Commented:
Hey thanks for quick reply... but I dont want image preload code.

I have a page which has "Take test" image button. On click it starts to load a test i,e question pages. This page is very large so it takes time to download. So after button click I want to show 'Please wait....' text above the image button itself untill the question page load was finished.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Saqib KhanSenior DeveloperCommented:

<title>Load Test</title>
function kk() {
document.getElementById("s").style.visibility = "visible"

<body topmargin="0" leftmargin="0" onLoad="kk()">
<div id="s" style="visibility:hidden">
<p><img border="0" name="ss" src="img1.jpg" width="800" height="600"></p>


Saqib KhanSenior DeveloperCommented:
so b/w the DIV tag is your Page Content.
And Customize your Loading.. message to anything you want.
Here is my proposal:

function showContent() {
  document.getElementById("wait").style.display = "none"
  document.getElementById("content").style.display = "block"
  window.document.title = "Content loaded.";
<body  onLoad="setTimeout('showContent()',5000)">
<div id=wait><center>
<img src="">
<div id="content" style="display:none;">
<H1>Some content</h1>

It hides the wait div after loading.

Change for your production this demo from this:
<body  onLoad="setTimeout('showContent()',5000)">

To this:
<body  onLoad="showContent()">

The five seconds are only for the demo wait time.

Good luck,

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.