Have you considered using http://zeptojs.com/ Zepto as your base? It's jQuery like, and easy to transition to full blown jQuery should you want, but not jQuery itself. And it's pretty light weight.
As far as using data attributes, cracking open the JS that twitter bootstrap is producing has been eye opening for me, so much that most of the code my company is generating is based on what they're doing (listening at a body level for certain events triggered by DOM elements with certain data attributes). We now create widgets that are fired on the page just by having a certain data attribute (like bootstrap's data-toggle), pass URL's, pubsub locators, and various assorted extra information that you would normally have to build into a JSON object to pass over the wire. One thing I'd like to see is not binding pubsub to DOM elements and instead binding them to a global javascript object like Ben Alman does with his https://gist.github.com/661855 jQuery pubsub . At my place of work, we have the problem of DOM garbage collection in AJAX widgets. If we're dependent on zone updates or multiple zone updates, often we have no idea what zone is being fired if we're listening at a high (body) level. The pubsub events don't pass any reference event information along with the pubsub custom event, so we fly a bit blind. Instead of allowing widgets (flyouts, modals, etc) to be created in the body, we have to limit their creation to the zone. Allowing some kind of information to be passed so the listener can know that a specific DOM zone event was triggered (so we can initiate DOM cleanup/teardown) would be a very handy tool. -- View this message in context: http://tapestry.1045711.n5.nabble.com/Script-Loaders-Modules-and-other-JS-thoughts-tp5676390p5681147.html Sent from the Tapestry - Dev mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
