B. Bibeault – jQuery in Action (3rd Edition, 2015)

1.365 

Автор: B. Bibeault
Название книги: jQuery in Action (3rd Edition, 2015)
Формат: PDF
Жанр: Компьютеры
Страницы: 506
Качество: Изначально компьютерное, E-book

foreword to the third edition
A decade ago, John Resig imagined a JavaScript library that would simplify the way
people built web sites. Today, that library, jQuery, is used by more than 80% of all web
sites that use JavaScript, according to BuiltWith.com. It would be hard to call yourself
a web developer today without knowing jQuery.
On the technical side, jQuery simplifies the long-winded native method calls that
browsers use and shrinks the number of lines of code that it takes to get things done.
That’s why jQuery’s motto is “Write less, do more.” jQuery also paves over the differences
in behavior—and even some outright bugs—that exist in browsers. That simplifies
both development and testing.
From the start, jQuery was designed so that it could be extended by others. The
jQuery plugin model lets anyone build specialized functionality on top of what jQuery
already offers. There are thousands of jQuery plugins that do everything from lightboxes
to form validation. The result is that many people with only a modest amount of
programming skill are able to create beautiful and functional web sites by building on
the work that others have done.
Still, code alone is not what made jQuery popular. From the beginning, a strong
community of helpful developers filled online forums and mailing lists to answer questions
for newcomers. The insight gained from those discussions led to better documentation,
training classes, and books like this one.
This book is a great way to learn jQuery. Early on, it covers a central tenet of
jQuery’s API, which is to select some elements on a web page and do something with
them. That same pattern applies whether you are hiding, showing, animating, removing,
or changing an element’s appearance. The selection process uses the standard CSS
selector syntax, with some jQuery enhancements that give selection even more power. I must confess that the chapter on events is my favorite because my first major code
contribution to jQuery was the rewrite of the event module in jQuery 1.7. This chapter
does a great job of explaining the purpose and usefulness of events on a web page,
which are the main way that you can be notified of how the user is interacting with the
web page. Nearly every jQuery operation you do is started through an event of some
kind.
I’m also glad this book covers some topics often ignored, such as unit testing and
organization of large projects. Many small projects eventually turn into large ones,
and the advice in these chapters can help you to manage that growth in a way that
reduces maintenance headaches.
The chapters building demo applications do a great job of showing how all the
parts of jQuery fit together and demonstrate important concepts like templating that
are central to all modern JavaScript frameworks and applications. Even today, I feel a
bit amazed by demos like this showing it’s possible to build something useful with very
little code.
Aurelio De Rosa has been a contributor to the jQuery community for several years
and is a member of jQuery’s content team that ensures jQuery’s online documentation
is up-to-date. His work on this latest edition of jQuery in Action gives you timely
information that reflects the most recent version of the library. Aurelio has also made
jQuery’s online documentation better in the process of writing this book by uncovering
inconsistencies and missing information. You, as a reader of this book and soon-tobe
jQuery developer, are the lucky beneficiary. Go forward and, “Write less, do more!”
DAVE METHVIN

about this book
This book is for web developers who want to delve into jQuery, the most popular and
adopted JavaScript library on the internet. The goal is to guide you, the reader,
through the path of becoming a pro of jQuery regardless of your starting level, beginner
or advanced. This tome covers the whole library in depth, including some additional
tools and frameworks such as Bower and QUnit, without forgetting to advocate
best practices. Each API method is presented in an easy-to-digest syntax block that
describes the parameters and the return value of the method.
jQuery in Action, Third Edition covers topics from the simple, such as what’s jQuery
and how to include it in a web page, to the advanced, such as the way the library
implements Promises and how to create jQuery plugins. To help you in this journey,
the content features many examples, three plugins, and three sample projects. It also
includes what we called Lab Pages. These comprehensive and fun pages are an excellent
way for you to see the nuances of the jQuery methods in action, without the need
to write a slew of code yourself.
The book assumes a fundamental knowledge of HTML, CSS, and JavaScript. A previous
knowledge of jQuery is not required but might come in handy to help you
absorb the concepts faster.
Roadmap
We’ve divided the book into three parts: an introduction to jQuery and what it brings
to the table, the jQuery core, where we cover all of its features, and a section on
advanced topics
Chapter 1 is about the philosophy behind jQuery and how it adheres to a principle
called unobtrusive JavaScript. It discusses what jQuery is, what problems it tries to
solve, and why you might want to employ it in your web projects.
Chapter 2 covers the selection of DOM elements via the use of selectors and how to
create your own custom selectors. We’ll also introduce you to the term jQuery collection
(or jQuery object), which is used to refer to the JavaScript object returned by jQuery’s
methods. It contains the set of elements selected on which you can operate with the
library.
Chapter 3 expands on chapter 2 by teaching how to refine or create a new selection
of elements starting with a previous selection. You’ll also learn how to create new
DOM elements with jQuery.
Chapter 4 focuses on the many methods jQuery offers for working with attributes
and properties, and what their differences are. Moreover, it explains how to store custom
data on one or more DOM elements.
Chapter 5 is all about manipulating element class names, cloning and setting the
content of DOM elements, and modifying the DOM tree by adding, moving, or replacing
elements.
Chapter 6 introduces you to the various event models and how browsers allow you
to establish handlers to control what happens when an event occurs. Then, we’ll cover
how jQuery allows developers to do the same thing while avoiding dealing with
browser incompatibilities. In addition, the chapter describes important notions like
event delegation and event bubbling.
Chapter 7 is different from the previous ones because its aim is to walk you
through the development of a project, a DVD discs locator, where you can apply the
lessons learned up to this point.
Chapter 8 examines the methods used to show and hide elements, and how you
can create animations. Function queuing for serially running effects, as well as general
functions, are also covered.
Chapter 9 is dedicated to utility functions, functions that are namespaced by
jQuery that usually don’t operate on DOM elements.
Chapter 10 covers one of the most important concepts of recent years: Ajax. We’ll
see how jQuery makes it almost brain-dead simple to use Ajax on web pages, shielding
us from all the usual pitfalls, while vastly simplifying the most common types of Ajax
interactions (such as returning JSON objects).
We set up a new challenge for you in chapter 11. Here, we’ll tackle a real-world
problem that many developers face: creating a contact form. The project consists of
building a working contact form that doesn’t require a complete reload of the page to
inform the user about the failure or success in sending the message.
Chapter 12 is the first of part 3 where we move onto advanced topics, most of
which are not strictly related to the core of the library. In this chapter, we’ll discuss
how to extend the functionality of jQuery by creating plugins for it. These plugins
come in two flavors: methods and utility functions. In this chapter we’ll examine both
of them
Chapter 13 explains how to avoid what’s known as the callback hell by describing
jQuery’s implementation of Promises. As you’ll learn, this is a delicate and controversial
topic that has been the subject of discussions for years.
In chapter 14 we introduce you to testing, what it is, and why it’s important. We’ll
focus our attention on one particular kind of testing: unit testing. Then, we’ll cover
QUnit, a JavaScript testing framework employed by some of the jQuery projects
(jQuery, jQuery UI, and jQuery Mobile) to unit test the code.
Chapter 15, the last chapter of the book, starts with tips and tricks to improve the
performance of code that uses jQuery by selecting elements the right way. Then, we’ll
broaden our focus to several tools, frameworks, and patterns not strictly related to
jQuery but that can be used to craft fast, solid, and beautiful code. In particular, this
chapter explains how to organize your code in modules, how to load modules with
RequireJS, and how to manage front-end dependencies with Bower. Finally, we’ll give
you a taste of how jQuery fits into single-page applications by skimming the surface of
Backbone.js.
To top it all off, we have provided an appendix highlighting key JavaScript concepts
such as function contexts and closures—essential to make the most effective use
of jQuery on our pages—for readers who are unfamiliar with, or would like a
refresher on, these concepts.

Описание

B. Bibeault - jQuery in Action (3rd Edition, 2015)

Отзывы

Отзывов пока нет.

Только зарегистрированные клиенты, купившие данный товар, могут публиковать отзывы.