Templating language for both client-side and server-side rendering

前端 未结 3 1642
你的背包
你的背包 2021-01-31 04:32

I\'m investigating JavaScript templates as a way to render our views. The goal is to be able to render client-side for users that have JavaScript enabled to to render the same t

3条回答
  •  没有蜡笔的小新
    2021-01-31 05:02

    Use EJS. It's pretty much got all the features you ask.

    It can be used with express.js out of the box and it works nicely on the client.

    As a bonus I would use backbone.js to do MVC on the client & server.

    Of course this does rely on node.js. I feel that using express, now & backbone allows you a lot of stable control with node.js. Not to mention that SSJS is simply awesome and that code re-use is fantastic.

提交回复
热议问题