title: How to check console.log output in chrome? Need to debug a .js file that uses XMLHttpRequest
body: <p>Here is my utube.js (copy of a tutorial):</p>
  
  <pre><code>let getXMLFile = function(path, callback) {
    let request = new XMLHttpRequest();
     request.open("GET", path);
     request.onreadystatechange = function() {
        if(request.readyState === 4 &amp;&amp; request.status === 200)
            {
              callback(request.responseXML);
            }
     };
     request.send();
  };
  
  getXMLFile("https://cors.io/?http://api.irishrail.ie/realtime/realtime.asmx/getStationDataByCodeXML_WithNumMins?StationCode='+Stationcode+'&amp;NumMins=90&amp;format=xml", function(xml) {
    console.log(xml);
  });
  </code></pre>
  
  <p>How can I check that this is gets the XML data I need? The content creator states 'you need to place it on a server or local host...' I tried placing the .js itself on my server and this simply opens it in a text format when I access it from my browser. Running the .js directly gives me a compile error (line 2, char 5, ';' expected).</p>
  
  <p>The creator can debug from the chrome console (console displayed error in red, when fixed he could read the actual XML data in the console output). How do I get to this step?:
  <a href="https://i.stack.imgur.com/xo7ri.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xo7ri.png" alt="enter image description here"></a></p>
  
  <p>I suspect I need to place the .js in a html doc, place that on my server and then access it from my browser? Not sure where the console comes into play however.</p>
  
  <p>Thanks for any help. This is my first time seriously using JS or attempting to use the console please try keep it simple!</p>