title: Handlebars Pass a string or Handlebars AST to Handlebars compile
body: <p>I know its been asked many times, I have looked at the answers and not sure where I am going wrong. </p>
  
  <p>I have looked at the docs on Handlebarsjs and followed a tutorial and both times I am getting the same error. </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
       &lt;script src="handlebars-v1.3.0.js"&gt;&lt;/script&gt;
       &lt;script src="jquery.min.js"&gt;&lt;/script&gt;
       &lt;script src="test.js"&gt;&lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;script id="header" type="text/x-handlebars-template"&gt;
        div {{ headerTitle }} div
        Today is {{weekDay}}
      &lt;/script&gt;
    &lt;/body&gt;   
  &lt;/html&gt;
  </code></pre>
  
  <p>And this is my Javascript</p>
  
  <pre><code>var theData = {headerTitle:"name", weekDay:"monday"}
  var theTemplateScript = $("#header").html();
  var theTemplate = Handlebars.compile(theTemplateScript);
  $(document.body).append(theTemplate(theData));
  </code></pre>
  
  <p>I keep on getting the following error and i am unsure why </p>
  
  <pre><code>Uncaught Error: You must pass a string or Handlebars AST to Handlebars.compile. 
  You passed undefined 
  </code></pre>