View Full Version : Help!! How can i do this? Plz read this.....

09-04-2007, 08:04 AM
Hi to all of you there.

i want to ask you something and it goes like that........

When we open a site, the page takes some to get load and wat i want is to display a user defined msg or the progress bar for that much time on the screen for all the pages in the website. plz do keep in mind that not after the page load i need it for before the page loads.

Waiting For your Replies................

Thanking You,

Philip M
09-04-2007, 08:28 AM
Do please read the posting guidelines about silly thread titles and incoherent questions.

Try this:-

<p>Displays progress bar in status bar and/or in a div in the page as required.</p>

<p><font color = #FF0000"></p>
<div id = "pbar"></div></font>

<script type = "text/javascript">
var percent = 10; // adjust starting value to suit
var timePeriod = 100; // adjust milliseconds to suit

function getBar() {
var retBar = '';
for (i = 0; i < percent; i++) {
retBar += "|";
return retBar;

function progressBar() {
if (percent < 100) {
percent = percent + 1;
document.getElementById("pbar").innerHTML = "&nbsp &nbsp &nbsp &nbsp Loading : " + percent + "%" + " " + getBar();
window.status = "Loading : " + percent + "%" + " " + getBar();
setTimeout ("progressBar()", timePeriod);
else {
document.getElementById("pbar").innerHTML = "";
window.status = "Your message here";
document.body.style.display = "";

It is your responsibility to die() if necessary… - PHP Manual

09-04-2007, 08:43 AM
thanks sir for this reply, and sorry from my side too for the reason being i havent quoted completely wat i want.
so here it goes..

Adding to wat i hav written earlier is: I want to use this code in my Dot Net Website and with a condition that the time for which the progress bar or the msg is there the person would not be able to click on any control of the page getting loaded.
So if this time you are able to help me. I will b thankful to you for this.

Thanks Once Again.

Philip M
09-04-2007, 08:53 AM
I can only suugest that on every control or link you add

onclick = "waitForIt()"

and add to the script

function waitForIt() {
if (percent <100) {
alert ("Please wait for the page to complete loading!);
return false;

BTW, the time to say "thanks" is afterwards, not before when the word "please" is usually considered polite. If you find this response helpful then please use the "Thank You For This Post" button.