4 ms·
JUP - Javascript Markup
- sjs 16y agoAwesome. If functions are allowed as data, evaluated as they're encountered, this has great potential.
- TrevorBurnham 16y agoLooks ideal if you need a lot of DOM with dynamically generated structure.
- Vekz 16y agoCould be powerful using node.js and a server side DOM implementation
- shaunxcode 16y agoJust typing out loud here: I usually just define a function called Tag which returns a jquery handle to said tag i.e. function tag(name) { return $('<' + name +'></' + name + '>'); } tag('div').append( tag('ul').append( tag('li').html('a'), tag('li').html('b'))) which would become: ['div', ['ul', ['li', 'a'], ['li', 'b']]] That seems substantially nicer to look at - but lacks the ability to easily add event handlers etc. that I get w/ the jquery approach. There is no reason it could not be inter-operable though: ['div', tag('span').html('click me').click(function(){alert('clicked')})];
- Sidnicious 16y agojquery-haml is a very similar project whose syntax is based on Haml: http://github.com/creationix/jquery-haml http://github.com/creationix/jquery-haml. I'm working on a templating extension to it, which'll be at http://github.com/Sidnicious/jquery-haml-templater http://github.com/Sidnicious/jquery-haml-templater.