Skip to content
Template objects that are jQuery objects that are template objects that are...
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Templating the jQuery way.

Beware: name and functionality are likely to change!

The what

Treat templates like standard jQuery objects.

The why

I'll get back to you.

The how

// Use an existing HTML blank.
<div id="feature"><h3></h3><p></p></div>

// Declare a template (with a custom initializer).
Feature = Template($("#feature"), function(title, text) {

// Now simply instantiate your Feature template object and treat it like
// any other jQuery object.
  new Feature("Amazing", "Sounds cool!")

// And you end up with this HTML.
    <p>Sounds cool!</p>

Or a simpler version just give starter tag and once again treat it like a jQuery object.

Word = Template("<span>")

new Word().html("<blink>I like blinkies</blink>")
Something went wrong with that request. Please try again.