O'Reilly logo

jQuery, jQuery UI, and jQuery Mobile: Recipes and Examples by Adriaan de Jonge

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 11. Creating Plugins

This chapter explains how to create your own plugins for jQuery. It starts with very basic recipes that can be used for small plugins. These simple recipes also demonstrate the basics of plugin development. In small steps, options, defaults, and methods are added.

When the plugin becomes too large, with superfluous copy and paste boilerplate code, the Plugin plugin is introduced. This generic plugin helps you to create your own plugins without copying boilerplate.

The second half of this chapter covers utility functions that help you to implement more advanced use cases inside your plugins. These utilities are called Callback and Deferred. jQuery uses these internally for functionality such as AJAX handling.

Recipe: ...

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