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

Chapter 2. Customizing jQuery

Okay, so we've downloaded a version of jQuery…what do we do next, I wonder?

This is a really good question—let me reveal all!

jQuery has, over the years, become an accomplished library and is used in millions of websites around the world. While we can usually find a way to fulfill a need using the library, there may be instances where we have to provide our own patch or alteration, to satisfy our needs.

We can use a plugin, but that gets tedious after a while—it soon becomes a case of "plugin this, plugin that" syndrome, where we become too reliant on plugins. Instead, we can look to the override functionality within jQuery itself; yes, it has some risks, but as we'll see, it is well worth the effort. Throughout this chapter, we'll cover the basics of overriding jQuery, some of the benefits and pitfalls of doing so, and work our way through some examples of replacing the functionality. We will cover the following topics:

  • Introducing duck punching

  • Replacing or modifying...