O'Reilly logo

Pro PHP and jQuery by Jason Lengstorf

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10. Extending jQuery

jQuery's easy-to-use syntax led developers to begin writing scripts to achieve custom effects and other tasks. To make these scripts configurable and reusable, these developers constructed these scripts as plugins, or scripts that extend jQuery by adding new methods to the library. In this chapter, you'll learn how to add your own plugins to jQuery.

Adding Functions to jQuery

In some cases, it may be desirable to add a function directly to the jQuery object, which means you would be able to call it like so:

$.yourFunction();

Adding functions to jQuery can help you keep your scripts organized and ensure that your function calls follow a consistent format. However, it's important to note that adding a function to jQuery ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required