4 karma · joined Dec 30, 2009 (16y ago) · 4 submissions
comment 16y ago · link · parent
If we had a new channel exclusively for things you've actually built it would be difficult to game it as you would have to actually put in efforts to built the thing in the first place. It would also be more in line with the HN ethos, for hackers by hackers :)
comment 16y ago · link · parent
For example,
var pjs = require('PaJes-CommonJS');
pjs.DIV(pjs.forEach(...));
This requires CommonJS module system to be in place (that is, function require() being implemented to be specific).Alternatively, it would be trivial to make non-CommonJS use namespace too by modifying PaJes.js. Do you need namespace in non-CommonJs setting?
Thanks for trying it out!
comment 16y ago · link · parent
var model = [ {name: "Lisa Simpson", id: 1}, {name: "Bart Simpson", id: 666} ]
DIV( {id:"demo-div", width: "60%"}, OL( {style: "list-style-type: upper-roman"}, forEach(model, studentDetails) ) ).display(out); out.flush();
function studentDetails(index, value) { return LI( value.name, A( {href:"/student-details?id="+value.id}, "details "+(index+1) ) ); }
4.
PaJes, Simple JavaScript Templating Library for generating HTML(saroskar.github.com ↗)
3 points · by saroskar · 16y ago · 3 comments