title: Using handlebars runtime library
body: <p>Can somebody help me with a sample code on how to use the handlebars runtime library (handlebars.runtime.js) please?</p>
  
  <p>I have tried to use Handlebars.compile, which obviously does not work, because I know runtime library is to avoid compiling templates.</p>
  
  <p>Also I have tried to use Handlebars.template method by passing the template as a string, but it is not working as the template method expects a function as a parameter.</p>
  
  <p>I think I am doing something basically wrong. Are there any documentations on how to use runtime library on its own?</p>
  
  <p>Much appreciate the help.</p>
  
  <p><strong>More details:</strong>
  I first used handlebars.js file, which was working good, but my team-mate noticed the compressed file is too big (>40KB) for our purpose (just a few templates in our site).</p>
  
  <p>So, I tried using just handlebars.runtime.js file. Is this correct, or am I missing something?</p>
  
  <p>Here is the sample I have tried: <a href="http://jsfiddle.net/2KfsM/" rel="nofollow">http://jsfiddle.net/2KfsM/</a></p>
  
  <pre><code>&lt;div id="container"&gt;&lt;/div&gt;
  &lt;script id="hb-example" type="text/handlebars-template"&gt;
    &lt;p&gt;{{sampleText}}&lt;/p&gt;
  &lt;/script&gt;
  </code></pre>
  
  <p>The js piece:</p>
  
  <pre><code>var template = Handlebars.compile($('#hb-example').html());
  $('#container').html(template({sampleText: 'Here is a sample'}));
  </code></pre>