Skip to content
forked from trix/nano

Simplest jQuery Templating Engine, perfect for JSON parsing

Notifications You must be signed in to change notification settings

krio-rogue/nano

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 

Repository files navigation

NANO - jQuery Template Engine

Basic Usage

Assuming you have following JSON response:

data = {
  user: {
    login: "tomek",
    first_name: "Thomas",
    last_name: "Mazur",
    account: {
      status: "active",
      expires_at: "2009-12-31"
    }
  }
}  

you can make:

$.nano("<p>Hello {user.first_name} {user.last_name}! Your account is <strong>{user.account.status}</strong></p>", data)

and you get ready string:

<p>Hello Thomas! Your account is <strong>active</strong></p>

Simple huh?

More Advanced Example

Displaying list of twitter search results (JSONP API)

http://jsfiddle.net/UXZDy/1/

About

Simplest jQuery Templating Engine, perfect for JSON parsing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%