« Carolina blue | Main | Details of Roller... »

Worth checking out: reglib vs jQuery

I've been doing a lot of JavaScript work lately for Project SocialSite and, to my surprise, enjoying it greatly. I've also been making use of JQuery, so Greg Reimer's post on reglib vs. JQuery really caught my eye.

Here's the opening blurb from the reglib project site:

CSS is nice because it lets you declare styles without worrying about DOM load, traversal or having to reattach styles as the DOM gets updated over the lifetime of the page. Which raises the question, why isn't the behavior layer similarly declarative?

/* the style sheet */
div.menu li > a { color: blue; }

/* why not a behavior sheet? */
div.menu li > a { click: function(e) { ... }; }

reglib's goal is to get as close to that as possible:

reg.click("div.menu li > a", function(e) { ... });

reglib is so named because it lets you "register" an event handler against a CSS selector. Like CSS, once the above code is "declared", the event handling behavior takes effect globally. This is true regardless of whether the onload event has fired, or whether the DOM has finished loading off the network, or whether arbitrary sections of DOM have been overwritten.

Cool stuff, huh? Check out the DEMO page Greg has put together "rigged like a science experiment" to demonstrate the differences between JQuery and reglib.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed

« Carolina blue | Main | Details of Roller... »

Welcome

This is just one entry in the weblog Blogging Roller. You may want to visit the main page of the weblog

Related entries

Below are the most recent entries in the category General, some may be related to this entry.