tags:

views:

24

answers:

1

hi am using this snippet for preload image using javascript

window.onload=function(){

heavyImage.src = "images/qq-lookupbody-holder.png"; (ON PAGE LOAD)

}

But am not find any different after i added this js snippet,

Is there any way to check , the preloader script is really worht or not....

+1  A: 
Pointy
chk my post updates plz
Bharanikumar
i just added between <head > </head> TAG...
Bharanikumar
How should i test preload img
Bharanikumar
Put it in the `<head>` but make sure you **don't** put it in a "window.onload" handler. To test it, you could use some sort of plugin like Firebug or TamperData to see whether the image is being fetched from cache or from your server. (Note that you should make sure your server is setting up the correct headers to make the image cacheable.)
Pointy
i downloaded the tamper plugin. now ..how to check image preloading or not
Bharanikumar
Well it might be a little tricky - again, if you're loading for the page the image is on, then the browser is going to have to load it anyway. The best you can do is hope to give the browser a "head start", so that it will start the HTTP transaction to fetch the image sooner. With TamperData you should see the GET for your image start up as one of the very first things after the initial GET for the page itself. If you see that, then you know it's working.
Pointy