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

前端 未结 3 1604
你的背包
你的背包 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 04:49

    I would opt for XSLT (http://www.w3schools.com/xsl/xsl_client.asp)

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2021-01-31 05:03

    We ended up picking dust.js. Check out Leaving JSPs in the dust and The client-side templating throwdown for more info.

    0 讨论(0)
提交回复
热议问题