When jQuery is not enough… plugins to the rescue!

This lesson covers

  • Why extend jQuery with custom code
  • Using third-party plugins
  • Guidelines for effectively extending jQuery
  • Writing custom utility functions
  • Writing custom methods for jQuery objects

Over the course of this app, you’ve seen that jQuery gives you a large toolset of useful methods and utility functions, and you’ve also seen that you can easily tie these tools together to give your pages whatever behavior you choose. Sometimes that code follows common patterns you’ll want to use again and again. When such patterns emerge, it makes sense to capture these repeated operations as reusable tools that you can add to your original toolset. In this lesson, we’ll explore how to capture these reusable fragments of code as extensions to jQuery called jQuery plug-ins. A jQuery plugin comes in two forms: as a jQuery method for jQuery collections (like find() or animate()) or as a utility function (like $.grep() and $.extend()). In this lesson we’ll cover both flavors.

When developing a project, it’s unlikely that you have the time to build everything you need from scratch, especially if the code has been developed by someone else. Therefore, we’ll also introduce some popular plugins you may want to look at.

But before any of that, let’s discuss why you’d want to pattern your own code as extensions to jQuery in the first place.


by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *