- View Offline
…Before we can begin building our first Mustache example, let's take…a look at how you define and then render Mustache templates.…So, just like in jQuery template, we're going to use…a script tag to hold the definition of our template.…Now, in this case, the type attribute is going to be slightly different.…It's going to be text/template.…And you should put an id on there, just like I have here.…Now, inside the template definition, we're going to have a container which…is going to hold the content of the results for the template.…
But you'll notice that this is a little bit different than the previous example.…So, back in jQuery template, we had data-attributes that were used to…define where the contents of the data would be put into the template.…Mustache is a little bit different.…Mustache uses two curly braces, followed by the name of…the field, followed by two curly braces going the other way.…So, if the data looks like this, which is the…same data that I showed in the jQuery Template explanation section.…
- What is templating?
- Defining templates in jQuery Template
- Using simple Mustache templates with sections and conditions
- Adding conditionals and loops to Handlebars templates
- Working with Dust templates