Re:Laconic: A Sane Method of Generating DOM Content in JavaS...
by joestelmach on Thursday April 26, 2012 @12:12AM
(#3892360)
Though I did a poor job at documenting it, $.el is actually a function that accepts a tag name as the first parameter. The following two snippets are equivalent:
$.el.div({className : 'foo'});
$.el('div', {className : 'foo'});
Re:Laconic: A Sane Method of Generating DOM Content in JavaS...
by firefoxman1 on Thursday April 26, 2012 @12:18AM
(#3892385)
That's awesome! Yeah I see it now in the source's comments. Thanks for pointing that out; I'm sold.
The problem I see is that this only works for "all known HTML tags." If you want to use custom tags, like <template> (I believe that's what meteor uses), this won't cut it since it uses $.el.tagname syntax, every tag has to be loaded into the $.el object.
How about a very similar, more jQuery-like syntax instead: