jQuery in Action

216
CHAPTER 7
Extending jQuery with custom plugins
You're now primed and ready to write your own jQuery plugins. When you
come up with some useful ones, consider sharing them with the rest of the jQuery
community. Visit http://jquery.com/plugins/ for more information.
7.5 Summary
This chapter introduced us to how we can write code that extends jQuery.
Writing our own code as extensions to jQuery has a number of advantages.
Not only does it keep our code consistent across our web application regardless of
whether it's employing jQuery
API
s or our own, but it also makes all of the power
of jQuery available to our own code.
Following a few naming rules helps avoid naming collisions between file-
names, as well as problems that might be encountered when the
$
name is reas-
signed by a page that will use our plugin.
Creating new utility functions is as easy as creating new function properties on
$
, and new wrapper methods are as easily created as properties of
$.fn
.
If plugin authoring intrigues you, we highly recommend that you download
and comb through the code of existing plugins to see how their authors imple-
mented their own features. You'll see how the techniques presented in this chap-
ter are used in a wide range of code and learn new techniques that are beyond the
scope of this book.
Having yet more jQuery knowledge at our disposal, let's move on to learn-
ing how jQuery makes incorporating Ajax into our Rich Internet Applications
a no-brainer.


Другие страницы

 
Cкачать книги бесплатно без регистрации в электронном виде (pdf, chm, txt).Вы можете читать книги онлайн на нашем сайте литературного портала книг.Большая подборка учебников, пособий, интересных книг.Электронные книги на английском языке скачать бесплатно без смс.