Top Qs
Timeline
Chat
Perspective
JavaScript templating
Client side data binding method implemented with JavaScript From Wikipedia, the free encyclopedia
Remove ads
JavaScript templating refers to the client side data binding method implemented with the JavaScript language. This approach became popular thanks to JavaScript's increased use, its increase in client processing capabilities, and the trend to outsource computations to the client's web browser. Popular JavaScript templating libraries are AngularJS, Backbone.js, Ember.js, Handlebars.js, JSX (used by React), Vue.js and Mustache.js. A frequent practice is to use double curly brackets (i.e. {{key}}) to call values of the given key from data files, often JSON objects.
![]() | This article includes a list of references, related reading, or external links, but its sources remain unclear because it lacks inline citations. (July 2013) |
Remove ads
Examples
Summarize
Perspective
All examples use an external file presidents.json
with following contents
{
"presidents" : [
{ "name": "Washington", "firstname": "George", "born": "1732", "death": "1799" },
{ "name": "Lincoln", "firstname": "Abraham", "born": "1809", "death": "1865" }
]
}
All examples will produce the following HTML list:
- Washington (1732-1799)
- Lincoln (1809-1865)
Templating becomes useful when the information distributed may change, is too large to be maintained in various HTML pages by available human resources and not large enough to require heavier server-side templating.
Remove ads
See also
References
- JavaScript templates, Mozilla Developer Network, 2013
- Basavaraj, veena (2012), The client-side templating throwdown: mustache, handlebars, dust.js, and more, Linkedin.com
- Villalobos, Ray (2012), Introduction to JavaScript Templating (video tutorial) with Mustache.js, ViewSource.com, archived from the original on 2013-05-13
- Burgess, Andrew (2012), Best Practices When Working With JavaScript Templates, Net.tutsplus.com
- Landau, Brian (2009), Benchmarking Javascript Templating Libraries
- http://www.jquery4u.com/javascript/10-javascript-jquery-templates-engines/
- Comparison with Other Frameworks, Vue.js, retrieved 11 December 2018
Wikiwand - on
Seamless Wikipedia browsing. On steroids.
Remove ads