title: Detect specific error (403) with JS
body: <p>I'm attempting to catch a potential error on my page, the page has a collection of URLs (retrieved at page load) to various resources which are loaded when needed. </p>
  
  <p>However these resources are only available for a set time, so if the user leaves the page idle for a long period, the URLs may no longer be valid and may return a 403.</p>
  
  <p>I'm currently detecting errors on the resources using something along the lines of:</p>
  
  <pre><code>$(".identifier").on("error", function () {
      console.log("Error on resource load");
  });
  </code></pre>
  
  <p>But can I detect the specific type of error / the error code? e.g. the 403 permissions error rather than a generic "There is an error". If possible I would like to be able to react differently to different errors.</p>