title: Need to get statuses of static files
body: <p>I need to get statuses(http codes) of static files on page.</p>
  
  <p>For example html code contains</p>
  
  <pre><code>&lt;link rel="stylesheet" type="text/css" href="theme.css"&gt;
  &lt;link rel="stylesheet" type="text/css" href="https://example.com/theme.css"&gt;
  &lt;script src="script.js"&gt;&lt;/script&gt;
  &lt;script src="https://example.com/script.js"&gt;&lt;/script&gt;
  &lt;img src="image.png"&gt;
  &lt;img src="https://example.com/image.png"&gt;
  </code></pre>
  
  <p>On output need to get json like this
  Only 404 needed.</p>
  
  <pre><code>{
    "css": [
      {
        "https://example.com/theme.css": "404",
        "https://example2.com/theme.css": "404"
      }
    ],
      "js": [
      {
        "https://example1.com/script.js": "404",
        "https://example.com/script.js": "404"
      }
    ],
        "images": [
      {
        "https://example.com/image.png": "404",
        "https://example.com/image.png": "404"
      }
    ]
  }
  </code></pre>
  
  <p>It must be done with only Javascript.</p>
  
  <p>I am going to use this</p>
  
  <pre><code>var xmlHttp = new XMLHttpRequest();
  xmlHttp.onreadystatechange = function() {
      if (xmlHttp.readyState == 4 &amp;&amp; xmlHttp.status == 200)
          callback(xmlHttp.responseText);
  }
  xmlHttp.open("GET", theUrl, true); // true for asynchronous
  xmlHttp.send(null);
  </code></pre>
  
  <p>It is necessary that upon receiving the status, this should not be done by executing a separate GET request to the file.</p>
  
  <p>But I can't find the way how to do this without executing a separate GET request.</p>
  
  <p>Who can find the solution?</p>