【发布时间】:2013-12-10 00:01:40
【问题描述】:
我有这个文件 test.html:
<script id="entry-template" type="text/x-handlebars-template">
template content
</script>
var source = $("#entry-template").html();
var template = Handlebars.compile(source);
这样我可以正确看到我的模板,但是由于我有很多模板要实现,所以我想把这部分放在
<script id="entry-template" type="text/x-handlebars-template">
template content
</script>
到外部文件中。
我正在使用 phonegap,然后我无法使用服务器端语言。 Handlebarsjs 是在 phonegap 中实现模板的好东西吗? 如果我使用 jquery.load 加载模板(仅在需要时)可能会更好?
谢谢
【问题讨论】: