Performer – Unobtrusive Prototype Helper

In a recent SitePoint blogs post by the estimable Kevin Yank he talks about Handling JavaScript-disabled Browsers. This is a vital part of making sure that any web application works correctly, and is something I spend a good proportion of my time doing.

Kevin rightly advocates something called progressive enhancement, which is a methodology designed to give a working system to everyone, but an enhanced experience to those that support more advanced technologies. It’s something I’ve talked about before.

In fact I’ll soon be giving away an initial version of my Performer JavaScript helper class (which I’ve talked about briefly before – good grief, was that really over a year ago?). basically it sits on your pages alongside the wonderful Prototype JavaScript library and allows the savvy developer to easily add AJAX-y style goodness to pages in an unobtrusive way. Let me give you a couple of examples:

Loading the content from a remote page when a link is clicked
<a href="ThisPage.php?With=RemotePageCall" class="loader" rel="Remotepage.php" rev="TargetElement">Click me to load the RemotePage.php file into targetElement</a>
Hide an element when the page is loaded
<div id="HiddenElement" class="hider">This element is hidden if the browser supports JavaScript, otherwise it is shown</div>

I plan on supporting several other features with the first release, including togglers, so watch this space.