Nothing precludes good old JSP for server-side templating. Why do a lot of work on the client if you don't have to?
The only time I use client-side templating is when I cannot use server-side templating because I'm directly accessing a RESTful API that serves JSON. Even then it's sometimes expedient to digest the web service on the server.
I guess it depends on a lot of factors that aren't apparent in your post.
Or, are you actually trying to figure out how to write exclusively client-side apps give a remote RESTful API?
Joined: Sep 09, 2008
Bear Bibeault wrote:Or, are you actually trying to figure out how to write exclusively client-side apps give a remote RESTful API?
Exactly, I am just trying to understand what the best practices are for structuring client-side apps that have dynamic content based on data retrieved from RESTful APIs...
There's one app I am working on where an embedded server is too wimpy to be able to run server-side templating. So I'm getting data from that server's RESTful API via Ajax, and using jQuery and its .tmpl() plugin to do client-side templating.
Given a choice, I prefer to do as much work on the server as possible -- but where that's not possible, client-side templating can do the trick.