title: javascript nodejs server not loading on browser
body: <p>I'm learning javascript basics and moving on to node.js for servers because of a beginners course and I learned to write the following code as an example basic server to test:</p>
  
  <pre><code>var http = require('http');
  
  
  
  function onRequest(request, response) {
      console.log("A user made a request" + request.url);
      response.writeHead(200, {"Content-Type": "text/plain"});
  
      response.write("Here is some data");
      response.end
  
  }
  
  http.createServer(onRequest).listen(8888);
  
  console.log("Server is now running..");
  </code></pre>
  
  <p>I learned this from a video which I will link here for reference:
  <a href="https://www.youtube.com/watch?v=pYOltVz7kL0&amp;list=PL6gx4Cwl9DGBMdkKFn3HasZnnAqVjzHn_&amp;index=13" rel="nofollow">nodejs tutorial</a></p>
  
  <p>1) Now the problem is if you look at from the point 8:50 onward in the video you can see that he shows a page that cannot be loaded on chrome <strong>before</strong> we run this code, but after we run it the IDE says "A User Made a Request" because of the code we wrote and refreshing the page gets a blank page with "Here is some data". </p>
  
  <p>Now I get the first part where the IDE says "A user made a request" but I don't get my page to load - after I run the code the page now <strong>does not</strong> return as a "page cannot be loaded" but its constantly trying to load and is completely blank and never loads. There is a circling spiral icon showing that its trying to load and thats it. Why is that and does anyone know why this is happening? I'm sure my code is exactly the same as his and nodejs is installed and selected as a a plugin to use (otherwise I would get errors for <code>"require()"</code> function which I don't).</p>
  
  <p>2) When he runs the code and tries to referesh page he gets 2 user requests one saying <code>"User made a request"</code> another saying <code>"User made a request/favicon.ico"</code>. Well I only get the first one, and I'm not sure why. Also the page does not load its just trying to load forever (see question 1). </p>