Building jQuery plugins: Back-end development for a front-end language
blog comments powered by Disqus
You've written a bit of jQuery. You understand its power and appreciate the ability to easily navigate the DOM, do some event delegation, and maybe even perform an Ajax request. But you've found yourself in need of a plugin. You've spent plenty of time searching for just the right one, but can't seem to find the perfect match. It either does too much or too little, and modifying these already complete plugins may be far more work than its worth.
So you've decided to write your own. Youre ready to apply your back-end developer mindset to a front-end problem. The only trouble is you don't quite know where to start. How do you define your plugin? Which jQuery selectors can you attach? What about a callback or options?