Skip to content

Instantly share code, notes, and snippets.

View davidgtonge's full-sized avatar

Dave Tonge davidgtonge

View GitHub Profile
@addyosmani
addyosmani / scraps.md
Created September 8, 2011 20:41
Scraps

/*Copyright Addy Osmani, 2011. Permission is not granted to re-publish this content unless otherwise stated. Its a work in progress :) */

#Essential jQuery Plugin Patterns (WIP)

##Introduction

I occasionally write about implementing design patterns in JavaScript. They're an excellent way of building upon proven approaches to solving common development problems and I think there's a lot of benefit to using them. That said, whilst well-known JavaScript patterns are useful, there's another side of development that can benefit from it's very own set of design patterns - jQuery plugins. The official jQuery plugin authoring guide offers a great starting point for getting into writing plugins and widgets, but let's attempt to take this further.

Plugin development has evolved over the past few years. We no longer have just one way of writing plugins, but many. They can be complex, they can be challenging but at the end of the day they can still be beautiful.I began to think about plugin patterns after seeing a nu