Answer the question
In order to leave comments, you need to log in
Why doesn't handlebars work?
<ul class="updates">
<script id="template" type="text/x-handlebars-template">
<li>
<h2>{{name}}</h2>
</li>
</script>
</ul>
<script src="js/jquery-1.11.1.js"></script>
<script src="js/handlebars-v1.3.0.js"></script>
<script type="text/javascript">
$(document).ready(function () {
var template = Handlebars.compile( $('#template').html() );
$('.updates').append( template(data) );
var data = {
name: 'Jane Doe'
}
});
</script>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question