title: Javascript document is not defined
body: <p>I have this error and I don't understand why:  <code>ReferenceError: document is not defined</code>.
  I tried to put <code>window.content.document</code>, but error <code>window</code> is not defined too. 
  I don't know where is the trick and specially I don't understand why?
  Worst when I take it off, I have as error <code>ReferenceError: $ is not defined</code> whereas I included jQuery in my html.</p>
  
  <p>this is my script.js:</p>
  
  <pre><code>var client = {};
  
  client.start = function (data) {
  
      setTimeout(function(data) {
      client.chart(data);
      }, 60);
  };
  
  module.exports.getJson= function(data){
  
      client.start(data);
  };
  
  client.chart= function (data) {
  
      //console.log(" this is the data" + data);
  
      $(document).ready(function() {
  
          $(function () {
            //Do my stuff
          });
      });
  };
  </code></pre>
  
  <p>and my html:</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html lang="en"&gt;
    &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
  
  
      &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script language="JavaScript" type="text/javascript" src="/js/jquery-1.2.6.min.js"&gt;&lt;/script&gt;
      &lt;script language="JavaScript" type="text/javascript" src="/js/sprinkle.js"&gt;&lt;/script&gt;
      &lt;script src="http://code.highcharts.com/highcharts.js"&gt;&lt;/script&gt;
      &lt;script src="http://code.highcharts.com/modules/exporting.js"&gt;&lt;/script&gt;
  
      &lt;script type="text/javascript" src="script.js"&gt;&lt;/script&gt;
  
    &lt;/head&gt;
    &lt;body&gt;
      &lt;div id="containerChart" style="min-width: 310px; height: 400px; margin: 0 auto"&gt;&lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Any ideas?</p>