NinjaScript: Javascript so unobtrusive, you’ll never it see coming
October 13, 2010
We're happy to announce NinjaScript: a jQuery plugin for unobtrusive scripting.
NinjaScript provides:
- CSS-like language for web page behavior
- Define rich behaviors that include both event handlers and transformations.
- Durable behaviors that survive DOM alteration, with performance comparable to jQuery's live() method.
- Handy built-in behaviors for AJAX.
Motivations
Unobtrusive Javascript is one of the coming movements in web design for a reason. Separation of concerns is generally a good thing, and the idea of separating behavior from semantics is pretty obvious once you think about it. If nothing else, it makes it much easier to think about how you structure your site. Just build it out as if this were still 1998 and you couldn't trust a browser to open an alert box, much less submit AJAX, then come back and mark everything up.
On the other hand, one hears a lot about "Unobtrusive Is Hard" and how a graceful degrade takes twice as long, etc etc. At the same time, software exists to encapsulate skills. Could be you'll be seeing a Rails plugin from LRD soon to convert the big Rails helpers into degrading versions.
Therefore: NinjaScript. Unobtrusive Javascript in a tidy package so that you can get on with your day.
What's it look like?
Here's a very simple example. Suppose you have an existing
Add A Comment