Contents tagged with jQuery
-
The event-extensible JavaScript (jQuery) pattern
In JavaScript we can employ the same basic principle mentioned earlier at the end of the dynamic page pattern post. That means, events (in the previous post: Orchard events, here: jQuery events and event handlers) are a great tool when you want to provide some dynamically, independently extensible frame for others to hook into. The framework just calls into the event methods, and "listening" codes simply get the message, without some explicit registration or upfront configuration. Today we'll see how easy it is to write extensible JavaScript code with jQuery events. (I'll make reference to the Orchard resource handling mechanism, but the principle is usable outsides Orchard too.)