Skip to content Skip to sidebar Skip to footer

Chrome Is Not Loading Img Src When Set In Javascript

I have a photo album which cycles through a series of images when the user clicks on FORWARD or BACK, implemented by Javascript setting the src of an img. It works properly on FF,

Solution 1:

maybe you may try to prefetch the image via ajax as explained in this : http://www.4thkingdom.com/public/computers/789073-web-site-speed-prefetching-images-css/view-post.html

Solution 2:

Cache is apparently being cleared out. Network tab shows chrome thinks it is loading the image from cache, when I tried clearing cache everything worked. Possibly this is a bug, where cache is being cleaned out but the index is not updated?

Thanks for the suggestions.

Solution 3:

I solved a similar problem arising from a reuse of Horizontal image scrolling -to see page wait for 20 second so timer go down- http://www.btinternet.com/~st_rise/main/mainfram.htm?../imagery/imgscroll3h.htm with a trick from www.ozzu.com/programming-forum/javascript-sleep-function-t66049.html

In my loop of loading image I call this function that simulate sleep.

functionpause( iMilliseconds ) {
    var sDialogScript = 'window.setTimeout( function () { window.close(); }, ' + iMilliseconds + ');';
    window.showModalDialog('javascript:document.writeln ("<script>' + sDialogScript + '<' + '/script>")');
}

You can see result in my site [elenco alloggi]: http://www.unitaria.it/interventi_u.html

Post a Comment for "Chrome Is Not Loading Img Src When Set In Javascript"