title: How to print content that is returned in http response using javascript
body: <p>I want to print in console content that are returned in http response. For example when I go to <a href="https://google.com" rel="nofollow">https://google.com</a> and in the tab Network I can see content such as scripts, text, document, png. I want to print names of all .png files.
  I tried to use something like that:</p>
  
  <pre><code>function hand () {
          console.log(this.getResponseHeader('content-type'));
  }
  var x = new XMLHttpRequest();
  x.open('GET', 'https://google.com', true);
  x.onreadystatechange = hand;
  
  x.send(); 
  </code></pre>
  
  <p>But it doesn't work for me. This action below is assigned for the button on me page.</p>