What's best practice to use js templating?

1 view
Skip to first unread message

Latrine

unread,
Oct 30, 2008, 5:45:04 AM10/30/08
to chainjs
I'm currently planning on a new project and I would like to remove the
burden of php-based templating.
In former projects some views were full of mixed html and <?php if..
for..?>.
At the end of the day the view weren't maintainable anymore. There is
too much of domain interruption in that way of coding - and MVC is
pattern is crippled.

Finally I stumbled upon js based templating.
My question is if it is a good way to use only html+js-templating+js
on client side and only a json-delivery on the serve sider?
Does anybody have any experience in doing projects only by using js-
templating without server based templating?
Or are there any issues unsolvable or leading in bad maintainability
at the end?

In my perception it is extremely attractive to be able to build the
view totally independent from server.
You get a click dummy very shortly (to present the customer) and
server-coding is reduced to its strength - data mangling and caching.

Would be great to here from your experience.

Cheers
Rick

P.S.: Sorry for cross-posting but chainjs and pure seem to me the only
active groups on that topic...

Eshan

unread,
Oct 30, 2008, 10:01:57 AM10/30/08
to chainjs
I was planning the same approach. One problem I ran into is that
search engines can't index your site properly. This may not matter
for your site, of course, but it's worth mentioning. It's too bad,
because it gives you a very nice separation between your data and
presentation. It also means you have api by which other applications
can read your data, if you want. If only Google could read it, too!
I explored the concept of Google crawling the web service directly,
but I didn't get very far.
Reply all
Reply to author
Forward
0 new messages