title: Simple script using ajax and node.js, why it don't work?
body: <p>I have html page:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Test&lt;/title&gt;
      &lt;script type="text/javascript"&gt;
          function pushMe(elem) {            
              var request = new XMLHttpRequest();               
  
              if (!request) alert("Error initializing XMLHttpRequest!");
  
              request.open('GET', 'proj1.js', true);
  
              request.onreadystatechange = function () {
                  if (request.readyState == 4)
                      elem.value = request.responseText;
              };         
              elem.value = '...';
              request.send(null);   
          }
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;input type="button" onclick="pushMe(this);" value="Push Me!" id="btn"/&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and js file (proj1.js):</p>
  
  <pre><code>var http = require('http');
  var url = require('url');
  var querystring = require('querystring');
  
  function accept(req, res) {
  
      res.writeHead(200, {
          'Content-Type': 'text/plain',
          'Cache-Control': 'no-cache'
      });
  
      res.end("HELLO!");
  }
  
  http.createServer(accept).listen(8080);
  </code></pre>
  
  <p>proj1.js and test.html are in the same folder.
  Why the value of button don't change, when I click buton?
  (It change, but request.responseText is empty, why it isn't "HELLO!"?)</p>