Book Image

Mastering jQuery

By : Alex Libby
Book Image

Mastering jQuery

By: Alex Libby

Overview of this book

<p>Mastering jQuery has been written not only to help maximize your skills with core functionality in the library, but also to explore some of the more intriguing ways of using the library to achieve real-world solutions that could feature on any website or online environment.</p> <p>You'll start with a look at some of the more advanced ways to incorporate the library into your pages, followed by working with forms and advanced form validation using regular expressions. Next you'll move on to animating in jQuery, advanced event handling, and using jQuery effects.</p> <p>Finally, you will develop practical examples of using jQuery with external functionality such as node-webkit, before finishing with a session on optimizing your version of the library for maximum efficiency and exploring best practices for using QUnit.</p>
Table of Contents (21 chapters)
Mastering jQuery
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Detecting signs of a poorly developed plugin


Imagine the scenario, if you will – you spend weeks developing a complex plugin, which does everything but the kitchen sink, and leaves anyone watching in awe.

Sounds like the perfect nirvana, right? You publish it on GitHub, create an awesome website, and wait for users to roll in and download your latest creation. You wait…and wait…but get a grand total of zero customers. Okay…so what gives?

Anyone can write code, as I always say. The key to becoming a better jQuery plugin developer is understanding what makes a good plugin, and knowing how to put that into practice. To help with this, let's take a moment to look at some pointers we can use to spot when a plugin is likely to fail:

  • You're not making a plugin! The accepted practice is to use one of a handful of plugin patterns. If you're not using one of these patterns (such as the one shown next), then there is a good chance that take-up of your plugin is likely to be low.

    (function($, window, undefined...