title: ReferenceError: document is not defined in Nodejs
body: <p>I want to show variable 'name' from nodejs in the html p tag with id='name'.
  when does the html page gets loaded?</p>
  
  <p><strong>view.html</strong></p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;TRY&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;p id="name"&gt;&lt;/p&gt;
  &lt;/body&gt;
    &lt;script type="text/javascript" src="try.js"&gt;&lt;/script&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>try.js</strong></p>
  
  <pre><code>var http = require ('http');
  var express = require('express');
  var app = express();
  var server = http.createServer(app);
  var name = "Ronish";
  app.use(express.static('public'));
    document.getElementById('name').innerHTML=name;
  server.listen('3030');
  console.log('Listening on port 3030');
  </code></pre>