Earlier quoted context omitted.
If you end up wrapping your code in an immediately called lambda anyhow I'm sure it would be fine.
Sort of, but there are some tags you probably don't want to pollute your own top-level namespace with, like a, b, i, object, p, q, and s. There's at least one tag (var) which is not allowed as an identifier on its own.
Laconic: A Sane Method of Generating DOM Content in JavaScript
31–40 of 51 posts
Re: Laconic: A Sane Method of Generating DOM Content in JavaScript
#32Re: Laconic: A Sane Method of Generating DOM Content in JavaScript
#33Re: Laconic: A Sane Method of Generating DOM Content in JavaScript
#34Re: Laconic: A Sane Method of Generating DOM Content in JavaScript
#35This is fine for small, one-person projects, but if you generate DOM content in your JS views it will come back to bite you in the ass once you hit a certain size. The first time you need to bring in a designer, or integrate a static mockup from a designer, you'll be wishing you used a template engine. You wouldn't embed database queries into your view controllers, so why would you couple your html to your javascript…
But I think your point about designers is a valid one for many projects.
Re: Laconic: A Sane Method of Generating DOM Content in JavaScript
#36This is pretty, but unfortunately the only performant way to generate dom elements in javascript is with HTML. HTML parsing is orders of magnitude faster in most browsers. How about a library like this to generate a string of HTML instead of dom elements?
Re: Laconic: A Sane Method of Generating DOM Content in JavaScript
#37Even more laconic: http://coffeekup.org/
Re: Laconic: A Sane Method of Generating DOM Content in JavaScript
#38Earlier quoted context omitted.
Sort of, but there are some tags you probably don't want to pollute your own top-level namespace with, like a, b, i, object, p, q, and s. There's at least one tag (var) which is not allowed as an identifier on its own.
I think 'a' and 'p' are the only ones among those you'd actually want. I could probably live with with those limitations.
Re: Laconic: A Sane Method of Generating DOM Content in JavaScript
#39Earlier quoted context omitted.
If you end up wrapping your code in an immediately called lambda anyhow I'm sure it would be fine.
Sort of, but there are some tags you probably don't want to pollute your own top-level namespace with, like a, b, i, object, p, q, and s. There's at least one tag (var) which is not allowed as an identifier on its own.
Re: Laconic: A Sane Method of Generating DOM Content in JavaScript
#40Even more laconic: http://coffeekup.org/