]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Merge pull request #9706 from erikarenhill/fix-util-imageloader-breaking-querystring
authorKevin Ball <kmball11@gmail.com>
Thu, 26 Jan 2017 22:37:44 +0000 (14:37 -0800)
committerKevin Ball <kmball11@gmail.com>
Thu, 26 Jan 2017 22:38:39 +0000 (14:38 -0800)
Now preserves the existing querystring questionmark if there already …

js/foundation.util.timerAndImageLoader.js

index b0875ee004d1b6eb6889e208a3f99d0c743103ac..cea9d1c0f1b7f6c8321cfb78794fadd3bfe55d0e 100644 (file)
@@ -67,7 +67,7 @@ function onImagesLoaded(images, callback){
     else {
       // fix for IE. See https://css-tricks.com/snippets/jquery/fixing-load-in-ie-for-cached-images/
       var src = $(this).attr('src');
-      $(this).attr('src', src + '?' + (new Date().getTime()));
+      $(this).attr('src', src + (src.indexOf('?') >= 0 ? '&' : '?') + (new Date().getTime()));
       $(this).one('load', function() {
         singleImageLoaded();
       });