using ajax with handlebars in node.js

假如想象 提交于 2019-12-11 13:30:15

问题


I have a file call item.handlebars, and it can be render using res.render('item').

The file look like this

<h1>{{title}}</h1>
<script>
//jquery events and manipulation
</script>

Now I want to load that template file with ajax. How do I do that? Do I need to include handlebarjs in client side?

I tried to do an ajax call to the endpoint and this is what I got in the response

You must pass a string or Handlebars AST to Handlebars.compile. You passed [object Object]

来源:https://stackoverflow.com/questions/34959973/using-ajax-with-handlebars-in-node-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!