I am running a slideshow using the javascript code below on my server Ubuntu 12.04.1. The problem, when I change the name of the images, then I get unlimited server responses 304 (not modified) on Chrome network tool. But, when I clear the browser history (cache), I get everything fine and just 5 network requests from Cache and not more like the screen shot attached.
I wonder why this happen and how to solve it? Screen shot attached for your kind reference! Would greatly appreciate if you hint me how to solve these unlimited requests? Thank you!
In the page index.php:
<SCRIPT>
//set image paths
src = ["ic/photo1.jpg", "ic/photo2.jpg", "ic/photo3.jpg", "ic/photo4.jpg", "ic/photo5.jpg"]
//set duration for each image
duration = 4;
ads=[]; ct=0;
function switchAd(){
var n=(ct+1)%src.length;
if (ads[n] && (ads[n].complete || ads[n].complete==null)) {
document["Ad_Image"].src = ads[ct=n].src;
}
ads[n=(ct+1)%src.length] = new Image;
ads[n].src = src[n];
setTimeout("switchAd()",duration*1000);
}
onload = function(){
if (document.images)
switchAd();
}
//-->
</SCRIPT>
<IMG NAME="Ad_Image" SRC="ic/photo1.jpg" BORDER=0>