title: Getting rid of the "Failed to load resource: the server responded with a status of 403 (Forbidden)" message when an image fails to load?
body: <p>If an image doesn't exist, or somehow an image just doesn't load, is there a way to make it so this message doesn't show up in the web inspector?</p>
  
  <blockquote>
    <p>Failed to load resource: the server responded with a status of 403 (Forbidden)</p>
  </blockquote>
  
  <p>I have tried these:</p>
  
  <pre><code>&lt;img src="/path.png" onerror="this.src = '/missing.png'; this.onerror = ''; return true;"/&gt;
  &lt;img src="/path.png" onerror="this.src = '/missing.png'; this.onerror = ''; return false;"/&gt;
  </code></pre>
  
  <p>And I've tried it in jQuery:</p>
  
  <pre><code>$(document).ready(function() { 
    $("img").error(function(event) {
      $(this).attr("src", "/missing.png");
      return false;
    }
  });
  </code></pre>
  
  <p>That message gets output in red before any of these event handlers get access to it, is there not a way to prevent this message from showing up?</p>
  
  <p>Ideally, I would be able to do this:</p>
  
  <pre><code>$("img").live("error", function() { $(this).attr("src", "/missing.png"); });
  </code></pre>
  
  <p>so I don't have to:</p>
  
  <ol>
  <li>Write inline javascript like <code>&lt;img onerror='x'/&gt;</code></li>
  <li>and it would work on dynamically loaded images.</li>
  </ol>