JavaScript Templating is a neat idea: it allows you to easily convert JSON to HTML without the work of parsing the it. At Microsoft's MIX10 conference, they announced that they would be starting to work with the jQuery team; one of their efforts was to provide a templating plugin. In this quick tip, I'll show you how to use it!
I know Devbhagat probably got past his issue, but for everyone else's edification:
There is no longer a "render"; you use "tmpl" instead.
dimondwoof 9 months ago
Hi,
Just tried to do it at my own today...
It gives me an error. render is not a function
$("#listTemplate").render is not a function
$("#listTemplate").render(data).appendTo("ul");
Devbhagat 10 months ago
This seems way more complicated than .append()
vesenthraiy 1 year ago
@crawlinoc 1) offload the templating logic from server developer to client developer 2) said client developer can make MVC style frontends easier without mixing display application state logic.
integral30 1 year ago
@crawlinoc - One thing I could think of is to have the organizing of the data into proper html tags from the server side to the client side .
sairamkunala 1 year ago
great stuff. what is the real life use?
crawlinoc 1 year ago
Really potent, thanks for this video.
Regards from Spain.
davilious 1 year ago