desandro/imagesloaded — Issue #8: IE9 + generated content in image source bug
Author: audiophil
Created: 2011-11-03 03:07:29+00:00
State: open

Hey, seeing as image preloading is pretty important when working with temaplating (tumblr, shopify, wordpress etc) I thought I'd pass this along.

There's a bug in IE9 that causes this script to occasionally fail. I believe I've tracked the problem down to CDN's appended generated content onto the end of the image url.

For example if you have an image titled "logo.png", after you upload it to a particular CDN, in our case the image's url was changed to "logo.png?1293". I'm still not certain exactly why this causes a problem with the imagesLoaded script, but I believe it has to do caching.

To get around this problem I capture the images source before it hits "imagesLoaded" and split it into an array and pop off anything I don't like and then update the image attributes to have the new fixed source. For me it was everything after and including the "?". All seems to work now.

Again this is only occurring for me and a colleague in IE9. Figured it could be of some use to you, or others.