Loading page function

well i posted about it some time ago, and i got 2 answers
1st answer: it says loading page until the page is really loaded which is what i wanted, but the problem here was that not the whole page was hidden. (u could scroll down with the mouse and see that the page content was not fully hidden)
2nd answer: i choose how much time to set for this loading page msg to appear, but now i figured out its just not gonna work out, i got 5 pages with images in them and waiting around 7 seconds each time u go to a page will just make visitors run away.

What i want is some function (in javascript or in ASP will do), that will make all of the page content hidden, until the page is fully loaded.

Thanks in advance,
Ulthane

Well yeah, thats it…
tested on opera/safari/ie/firefox/chrome, on few of them it worked and on othes needed to wait around 3 seconds (in IE even more, too bad most of the pple are using IE :/) until the loading image msg appeared.

Well i belive waiting a few seconds wont harm anyone, at least now the page doesnt need to be hidden for around 7 seconds every time a person loads it :slight_smile:

Thanks for all of ur support pmw57 :slight_smile:
Ulthane

The previous version of the page didn’t work for me.
This updated version of the page works for me.

Make sure that your local web browser is seeing and using the updated version from the web site. Often your web browser will cache the previous version that uses to be there. If that’s the case, Ctrl+F5 or Shift+F5 should force the new version to be loaded for you.

it shows u the loading image msg when viewing an image? its still not working for me…
i just tried to run it from brinkster aswell, doesnt show that msg there aswell,

Maybe its a matter of what browser is being used…?

Possibly. I tried again and am told by Brinkster that your bandwidth has been exceeded.

try at http://saharatias.brinkster.net/dogs.asp
my daily bandwidth is limited to 17 mb :stuck_out_tongue:

Yep, working for me there too, but now exceeded too :slight_smile:

lol, ok ill check it with a few different browsers later to see what causes it,
Thanks for all ur help :slight_smile:

Its not working, no matter where i put the script, it wont show the Loading image div at all, it just waits for the whole page to load and then when u click an image it’ll enlarge it like it should do, if u do it before the page loads it’ll take u to a different page…
u can take a look urself at
http://sospets.brinkster.net/dogs.asp

Thanks in advance,
Ulthane

it is fully hidden even now, but for 7 seconds always, no matter if ur browser will load the page in 4 sec or so…
I did it because of the thumbnailviewer.js function, pple cannot enlarge images until the page is fully loaded (if they click on it before the page is loaded, it shows the image on a different page and then they need to go back to the previous page again, as well as waiting another 7 seconds…)
i wanted at first to make it so when some1 click an image that wasnt fully loaded yet, it tells “Loading image” but i dont know how…

so i just want to mimic the time needed for a page to be loaded, any function that will help achieving it will be perfect…

Thanks in advance,
Ulthane

That must be one of the ancient scripts from dynamic drive.

By moving the script file to the end of the body, you can remove the onload delay, and run the init process immediately, which attaches the expected events on to the images before the page has finished loading.

If it takes 7 seconds for the page to be fully loaded, where visitors will run away, what benefit will it achieve to completely hide the page?

yes im testing from home atm which im changing
Updated the new dogs.asp and thumbviewer.js files on brinkster now however if u wanna take a look

Thanks in advance,
Ulthane

still the same problem :confused:

Do you have a test page? The page that you linked to before appears to be unchanged.

I think that it’s our internet speed that’s proving the difference. I have a fast broadband connection. It takes only a few seconds for the page to load, but even then, when I click on the image as soon as it appears on the page, it still works for me.

I suggest that we find someone else with a slow connection to carry on the testing.

well i’ve just checked it with Firefox and IE, it doesnt work with any of them…

Moving the script is only one part of the solution.

You should move your script to the end of the body, just before the </body> tag. Putting your script at the bottom is good [url=“http://developer.yahoo.com/performance/rules.html”]best practice for speeding up your web site.

Once you have done that, the script will be allowed to manipulate the document before it has loaded. You can then change the script so that instead of this:

Existing script:


thumbnailviewer.createthumbBox() 
thumbnailviewer.dotask(window, function(){thumbnailviewer.init()}, "load") 
thumbnailviewer.dotask(window, function(){thumbnailviewer.cleanup()}, "unload")

You update the middle line to have the script do this instead:


thumbnailviewer.createthumbBox() 
thumbnailviewer.init();
thumbnailviewer.dotask(window, function(){thumbnailviewer.cleanup()}, "unload")

Now the links will load as you desire, even when people click on them before the page as finished loading.