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:


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 ...

Get Pro PHP and jQuery now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.