title: Preloading images with JavaScript
body: <p>Is the function I wrote below enough to preload images in most, if not all, browsers commonly used today?</p>
  
  <pre><code>function preloadImage(url)
  {
      var img=new Image();
      img.src=url;
  }
  </code></pre>
  
  <p>I have an array of image URLs that I loop over and call the <code>preloadImage</code> function for each URL.</p>