Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

jQuery.tpl without jQuery

branch: dev

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 index.html
Octocat-spinner-32 jquery.js
Octocat-spinner-32 jsTPL.block.js
Octocat-spinner-32 jsTPL.filter.js
Octocat-spinner-32 jsTPL.js
Octocat-spinner-32 test.html
README.rdoc

jsTPL project: simple, fast and powerfull templates for javascript and jQuery(github.com/donnerjack13589/jQuery.tpl).

It's easy to learn - start now!

Basic examples:

jsTPL(“1 + 1 = {%= 1+1 %}”)(); // 1 + 1 = 2 jsTPL(“Hello {%= a %}!”,[“a”]) ({a: 'World'}); // >> Hello World! jsTPL(“Hello {%each a%}{%= this %}, {%/each%}world!”,[“a”]) ({a: ['Andy','Alex']}); // >> Hello Andy, Alex, World! jsTPL(“{%if godmode%}My Lord!{%else%}Who are you?{%/if%}”,[“godmode”]) ({godmode: true}); // >> My Lord!

Medium examples:

jsTPL(“{%catch var a %}What's up, dude?{%/catch%} {%= a.substr(0,9) %}?”)(); // >> What's up? jsTPL(“{%~ var a = true; %}{%if !a %}'a' is false?{%/if%}”,[“a”])(); // >> 'a' is false? jsTPL(“{%@ name(value) { return '~' + value + '~' } %}{%= name('fancy')%}”)() // >>~fancy~

Block module

jsTPL(“<div>Hello, {%block 'username'%}{%/block%}!</div>”,[],“block”); jsTPL(“{%extends 'block'%}{%block 'username'%}Admin{%/block%}”)().html(); // >> Hello, Admin!

Something went wrong with that request. Please try again.