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

Patching the library on the run


Over the years, hundreds of developers have spent countless hours creating patches for jQuery, to either fix a bug of some description or provide new functionality within the library.

The usual route is to submit a pull request against the Core jQuery library for peer consideration. As long as the patch works as expected and does not cause issues elsewhere in the library, then it will be submitted to core.

The downside of this approach means that we're constrained by the release schedule for jQuery; while the developers do an outstanding job, it nevertheless can take time before a patch is committed to core.

Introducing monkey patching

What to do? Do we wait in the hope that our patch will be committed?

For some, this won't be an issue—for others, patience may not be their strongest virtue and waiting is the last thing they will want to do! Fortunately, we can get around this by using a method called monkey patching.

Now—before you ask—let me tell you that I'm not...