title: execute javascript from html - node.js
body: <p>I hava an html file that execute js file inside.
  Now I want to run this with Node.js server.
  I can see that it write the html file in it (it write 'hi (:') but ignored the js file.</p>
  
  <p>this is the 'server.js' file:</p>
  
  <pre><code>var fs = require('fs');
  var http = require('http');
  var content;
  //read the file
  fs.readFile('index.html', function read(err, html) {
      if (err)
      {
          throw err;
      }
  
      content = html;
  
  http.createServer(function(request,response)
  {
      response.writeHead(200,{"Content-Type": "text/html"});
      response.write(html);
      response.end();
  }).listen(8081);
  
  console.log("listening on port 8081");
  });
  </code></pre>
  
  <p>and this is the 'index.html' file:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;script src="http://code.jquery.com/jquery-2.1.0.min.js"&gt;&lt;/script&gt;
          &lt;script src="script.js"&gt; &lt;/script&gt;
          &lt;script&gt; &lt;/script&gt;
          &lt;/head&gt;
      &lt;body&gt;
          &lt;div id="empty"&gt;
              hi :)
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Thanks for your help! (:</p>