Javascript handlebar.js无输出

Javascript handlebar.js无输出,javascript,jquery,handlebars.js,Javascript,Jquery,Handlebars.js,我真的在为Handlebar.js而挣扎。下面的示例是我的测试html文档的范围 我无法理解为什么html变量没有写入所需的上下文内容,也没有提供输出: <!doctype html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.js"></script> <script src="js/handlebars-v4.

我真的在为Handlebar.js而挣扎。下面的示例是我的测试html文档的范围

我无法理解为什么html变量没有写入所需的上下文内容,也没有提供输出:

<!doctype html>

<head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.js"></script>
    <script src="js/handlebars-v4.0.5.js"></script>
</head>

<body>
    <script id="entry-template" type="text/x-handlebars-template">
        <div class="entry">
            <h1>{{title}}</h1>
            <div class="body">
                {{body}}
            </div>
        </div>
    </script>
    <script type="text/javascript">
        var source = $("#entry-template").html();
        var template = Handlebars.compile(source);
        var context = {
            title: "My New Post",
            body: "This is my first post!"
        };
        var html = template(context);
    </script>
</body>

</html>

{{title}}
{{body}}
var source=$(“#条目模板”).html();
var template=handlebar.compile(源代码);
变量上下文={
标题:“我的新帖子”,
正文:“这是我的第一篇帖子!”
};
var html=模板(上下文);

将调用模板函数的结果分配给变量不会对任何事情产生任何可见的影响。您只需要得到一个名为“html”的变量,其中包含一些文本。好的,您将如何将其写入正文?使用JQuery?
document.body.innerHTML=模板(上下文)