I use mustache for templating my javascript ajax calls, Here is my data and the template:
{'joined':1} // ajax responde data json.
var myTemplate = '{{ joined }} person joined so far.'
It works, however I want to fix the grammer in this, if more than 1 person joins, I want to show 5 people joined so far.
How to achieve this without manipulating the server side ajax json responder ?
You can add conditional logic inside the JavaScript object, if you can coax your server-side AJAX into delivering it that way:
http://jsfiddle.net/mblase75/H8tqn/