title: Javascript Document isn't loading
body: <p>I have a webpage, and it is running <code>index.html</code>:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  
  &lt;html lang="en" xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;title&gt;Title&lt;/title&gt;
  &lt;/head&gt;
      &lt;style&gt;@import 'main.css'&lt;/style&gt;
      &lt;script src="/socket.io/socket.io.js"&gt;&lt;/script&gt;
      &lt;script src="https://code.jquery.com/jquery-1.11.1.js"&gt;&lt;/script&gt;
      &lt;script src="main.js"&gt;&lt;/script&gt;
  &lt;body&gt;
    &lt;canvas id='svs'&gt;&lt;/canvas&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>For some reason, when I try to use <code>c = document.getElementById('svs')</code> in <code>main.js</code>, it just returns <code>null</code>. What am I doing wrong and how can I access <code>document</code> in <code>main.js</code>?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I'm using <code>socket.io</code> and <code>express</code> and am sending <code>index.html</code> through <code>res.sendFile</code>. </p>
  
  <p>I'm sending <code>main.css</code> and <code>main.js</code> through a folder with <code>express.static</code>.</p>