AJT (Ajax JSON Template)
How simple can it be to do an Ajax-Request, get JSON and put this into a template? Simple and lightweight: 3 KB
!
;
and your template is a vanillaJS compiled jade template :)
- does that sound sweet? It does!
h2= value1code= value2
That it, simple and intuitiv!
Documentation
ajt
is looking for three parameters, the request URL
, the templateID
and the callback
. Everything else is done by ajt.js
.
Bundling
You can eitherway bundle it by using the node module, or the command line:
var ajt = ;var js = ;// ...
$ ajt -t jadeTemplates -o myoutput.jsor$ ajt -t jadeTemplates
You even can do:
$ ajt -t jadeTemplates -t moreTemplates -o myoutput.js
Contributors
- milafrerichs - he kind of had the idea ;)