title: Can't pass data to handlebars template
body: <p>I am following the tutorial at <a href="https://www.youtube.com/watch?v=3zVYH16yogQ&amp;t=58s" rel="nofollow noreferrer">https://www.youtube.com/watch?v=3zVYH16yogQ&amp;t=58s</a> about rendering data in handlebars template but can't seem to pass the data to the template.</p>
  
  <p>My global.js file: </p>
  
  <pre><code>    $(document).ready(function(){
  
  
  
  var source = $("#first-template").html();
  var template = Handlebars.compile(source);
  
  
  var context = {
    title1 : "hello",
    body1 : "body1"
  }
  
  var el_html = template(context);
  
  $("#render_here").html(el_html);
  $("#render_here_again").html(el_html);
  
  
  });
  </code></pre>
  
  <p>My view file:</p>
  
  <pre><code>    &lt;html&gt;
  &lt;head&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"&gt;&lt;/script&gt;
      &lt;link href="http://fontawesome.io/assets/font-awesome/css/font-awesome.css" rel="stylesheet" media="screen"&gt;
      &lt;script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"&gt;&lt;/script&gt;
  
    &lt;script type="text/javascript" src="../javascripts/global.js"&gt; &lt;/script&gt;
      &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/handlebars.js/2.0.0/handlebars.js"&gt;&lt;/script&gt;
  
  
  &lt;/head&gt;
  &lt;body&gt;
      &lt;button name = "click" id ="click" &gt;click &lt;/button&gt;
  &lt;div id ="render_here"&gt;
    first
  &lt;/div&gt;
  
  &lt;div id ="render_here_again"&gt;
    second
  &lt;/div&gt;
  
  &lt;script id = "first-template" type="text/x-handlebars-template"&gt;
            &lt;div&gt;
                  &lt;h1 style ="color:green"&gt;{{title1}}&lt;/h1&gt;
                  &lt;h2 style ="color:blue"&gt;{{body1}}&lt;/h2&gt;
          &lt;/div&gt;
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When rendering the page the data from the context variable should be loaded, however it is blank. I can see the object when I log it in the console, and when I console.log(el_html) the script template comes up but without the context. Any idea what I'm doing wrong?</p>