WHAT’S IN THIS CHAPTER?
- Why Use Templates?
- The Past, Present, and Future of jQuery Templates
- Creating and Using Templates
In this chapter, you learn about the jQuery Template plugin. jQuery Templates are a standard way of marrying data and markup snippets. If you’re familiar with template engines like Freemarker or Mustache, you’ll recognize a lot of what jQuery Templates try to accomplish. If you’ve done any Ajax-based development, you’ve had to build blocks of HTML for insertion into the document based on the result of an Ajax request or other user interaction. Typically, this has meant concatenating strings or building elements using native DOM methods and then inserting them into the DOMr. jQuery Templates simplify and standardize this common task.
TAMING A TANGLE OF STRINGS