title: javascript check if image is in browser cache
body: <p>I have the following code to check if an external image is cached or not</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function cached(url){
         var test = document.createElement("img");
         test.src = url;
         return test.complete || test.width+test.height &gt; 0;
      }
      var base_url = "http://www.google.com/images/srpr/nav_logo80.png"
      alert("Expected: true or false\n" +
          cached(base_url)
          + "\n\nExpected: false (cache-busting enabled)\n" +
          cached(base_url + "?" + new Date().getTime()));         
  &lt;/script&gt;
  </code></pre>
  
  <p>I get the following result false false, then true false on firefox and IE (which I assume is that it first fires false false,then after it grabs the image, it fires true,false, but in chrome it is false, false always</p>
  
  <p>any reason why?</p>