JavaScript Module Pattern Variations

31st August, 2007 @ 9:02am BST

Development, JavaScript, Tutorials, Web / 4 Comments

The JavaScript Module Pattern is a handy pattern for JavaScript singletons. It allows a developer to scope variables and methods to a given module with both private and public visibility.

Originally proposed by Douglas Crockford (and blogged on the YUI blog by Eric Miraglia), the Module Pattern has recently been through several iterations of pimpage (look Ma — a new buzzword!) at the hands of Christian Heilmann; the first entitled “Show love to the Module Pattern” and the second, “Again with the Module Pattern“. Before reading this post, I’d recommend you read all of these articles otherwise this is going to make very little sense!

Having used the pattern quite regularly over the last six months or so, I’d like to add my two-pennies-worth to the discussion with a couple of variations on the theme…

Read more of “JavaScript Module Pattern Variations”…

Fixing label in Safari

30th August, 2007 @ 9:46am BST

Accessibility, Browsers, Development, JavaScript, Web / 2 Comments

Safari, the excellent WebKit-based browser from Apple, has long neglected to include functionality that activates a form element (such as an input, a textarea, a select etc.) when its relevant label is clicked.

Although this behaviour has been fixed in the beta of version 3, any users still browsing with version 2 or below still suffer this needless blight on web accessibility.

I’ve recently reworked the JavaScript used in Steve Marshall’s tasty channelled search solution, which requires the label to be clickable, as it hides the corresponding radio input. For this reason, I’ve written a quick bit of JavaScript to activate this behaviour.

Read more of “Fixing label in Safari”…

AjaxEvent: Using YUI custom events with Ajax

13th July, 2007 @ 8:58am BST

Ajax, Development, JavaScript, Web / 6 Comments

Recently, I’ve been working on some fairly Ajax intensive pages and, because I’m working in a team environment, the need arose for a simple bit of script to handle all the different Ajax “events”. This script needed to be small yet easy to implement

Enter the YUI. *cue Enter The Dragon theme*

So here’s a tasty little script that wraps Ajax requests and a YUI Custom Event in an instantiable object that works as an Ajax DAO

Read more of “AjaxEvent: Using YUI custom events with Ajax”…

Previous Entries

Table of previous blog entries
Title Date Comments
Babies! 2007.06.20 2 Comments
As featured in .net magazine! 2007.04.15 3 Comments
Semantics and Structure 2007.03.05 20 Comments
Learning JavaScript 2007.01.29 11 Comments
Alegria 2007.01.13 1 Comments

© 2008 Tim Huegdon, All Rights Reserved / Website design and development by Nefarious Designs

Powered by Wordpress 2.3 / Login

This website contains no artificial colourings or preservatives. Just 100% WIN.