Template

Templating the jQuery way

Beware: name and functionality are likely to change!

Example

The above was generated with:

Feature = Template($("#feature"), function(title, text) {
  this.find("h3").text(title)
  this.find("p").text(text)
})

Word = Template("<span>")

$("#features").append(
  new Feature("Amazing", "Sounds cool!"),
  new Feature("Brilliant", "Ok ok..."),
  new Feature("Capital", "...capital?")
  new Word().text("And "),
  new Word().text("some "),
  new Word().text("more "),
  new Word().text("words "),
  new Word().text("here.")
)
Fork me on GitHub