title: Using image.complete to find if image is cached on chrome?
body: <p>I have been trying to find out if an external image is cached on the browser with js, this is the code I have so far:</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;&lt;/head&gt;
      &lt;body&gt;
  
      &lt;script src="http://code.jquery.com/jquery-1.4.2.min.js"&gt;&lt;/script&gt;
  
      &lt;script&gt;
  
          function cached( url ) {
              $("#imgx").attr({"src":url});
              if(document.getElementById("imgx").complete) {
                  return true;
              } else {
                  if( document.getElementById("imgx").width &gt; 0 ) return true;
              }
  
              return false;
          }
  
      &lt;/script&gt;
  
      &lt;img id="imgx" src=""  /&gt;
  
      &lt;script&gt;
  
          $(document).ready(function(){
              alert(cached("http://www.google.com/images/srpr/nav_logo80.png"));
          });
  
      &lt;/script&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>It works perfectly on firefox but it always returns false on chrome.</p>
  
  <p>Does someone has any idea how to make it work with chrome?</p>