I'm removing and replacing the src of an image in the dom using
$('.myImg').attr('src',imgURL);
I'm trying to use this with an on load event. I expected that the load event would only be triggered if imgURL hadn't already been loaded on the page.
Instead, sometimes, the load event is triggered. I can see when it is that in the chrome network tab that the image is returning with a 304 Not Modified status.
I know how to work around this issue, but I'm just curious as to if this is normal.
I guess the best way to phrase this question is what would cause the browser to try to load an image again that has already been loaded onto the page once? There is a cache killer in place, however it's not being updated before I display the image again.