title: Reload all images on page
body: <p>I'm trying to get all the images in the page to reload including <code>backgound-image:</code> rules</p>
  
  <p>I have some semi working code but I want to know if there is an easier way of doing this.</p>
  
  <pre><code>function cacheBuster(url) {
      return url.replace(/\?cacheBuster=\d*/, "") + "?cacheBuster=" + new Date().getTime().toString();
  }
  
  $("img").each(function() {
      this.src = cacheBuster(this.src);
  });
  
  $("*").each(function() {
      var bg_img = $(this).css("background-image");
      if (bg_img !== "none") {
          var url = /url\((.*)\)/i.exec(bg_img);
          if (url) {
              $(this).css("background-image", "url(" + cacheBuster(url[1]) + ")");
          }
      }
  }); 
  </code></pre>