Professional jQuery 1st Edition Cesar Otero - Own the complete ebook set now in PDF and DOCX formats
Professional jQuery 1st Edition Cesar Otero - Own the complete ebook set now in PDF and DOCX formats
https://ebookultra.com/download/professional-xmpp-programming-with-
javascript-and-jquery-1st-edition-jack-moffitt/
https://ebookultra.com/download/representing-cultural-diplomacy-first-
edition-cesar-villanueva/
https://ebookultra.com/download/smashing-jquery-1st-edition-jake-
rutter/
https://ebookultra.com/download/mastering-jquery-mobile-1st-edition-
lambert/
Learning jQuery Third Edition Jonathan Chaffer
https://ebookultra.com/download/learning-jquery-third-edition-
jonathan-chaffer/
https://ebookultra.com/download/jquery-and-javascript-phrasebook-1st-
edition-brad-dayley/
https://ebookultra.com/download/murach-s-jquery-2nd-edition-zak-
ruvalcaba/
https://ebookultra.com/download/drupal-6-javascript-and-jquery-1st-
edition-matt-butcher/
https://ebookultra.com/download/jquery-mobile-up-and-running-1st-
edition-maximiliano-firtman/
Professional jQuery 1st Edition Cesar Otero Digital
Instant Download
Author(s): Cesar Otero
ISBN(s): 9781118260791, 1118260791
Edition: 1
File Details: PDF, 21.99 MB
Year: 2012
Language: english
ffirs.indd ii 22/03/12 9:13 AM
PROFESSIONAL JQUERY™
INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
INDEX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
jQuery™
Cesar Otero
Rob Larsen
ISBN: 978-1-118-02668-7
ISBN: 978-1-118-22211-9 (ebk)
ISBN: 978-1-118-23592-8 (ebk)
ISBN: 978-1-118-26079-1 (ebk)
10 9 8 7 6 5 4 3 2 1
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means,
electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108
of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization
through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive,
Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed
to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011,
fax (201) 748-6008, or online at http://www.wiley.com/go/permissions.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with
respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including
without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or
promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work
is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional
services. If professional assistance is required, the services of a competent professional person should be sought. Neither
the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is
referred to in this work as a citation and/or a potential source of further information does not mean that the author or the
publisher endorses the information the organization or Web site may provide or recommendations it may make. Further,
readers should be aware that Internet Web sites listed in this work may have changed or disappeared between when this
work was written and when it is read.
For general information on our other products and services please contact our Customer Care Department within the
United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with
standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media
such as a CD or DVD that is not included in the version you purchased, you may download this material at
http://booksupport.wiley.com. For more information about Wiley products, visit www.wiley.com.
Library of Congress Control Number: 2012932975
Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade dress
are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affi liates, in the United States and other
countries, and may not be used without written permission. jQuery is a trademark of Software Freedom Conservancy
Corporation. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc., is not associated
with any product or vendor mentioned in this book.
ROB LARSEN has more than 12 years’ experience as a front-end engineer and team
leader, building websites and applications for some of the world’s biggest brands.
He is currently a Senior Specialist, Platform at Sapient Global Markets.
Prior to his time at Sapient, Rob spent time at Isobar, The Brand Experience,
Cramer, and as an independent consultant. Over the course of his career, Rob has
solved unique problems for clients like Adidas, Motorola, Philips, Reebok, Gillette,
Boston’s Museum of Science, State Street Corporation, and Harvard Kennedy School.
Rob is an active writer and speaker on web technology with a special focus on emerging standards
like HTML5, CSS3, and the ongoing evolution of the JavaScript programming language. He’s also
active in the open-source community, helping to bridge the gap between the front lines of web
development and the people actively working on the tools that drive the web.
MANY THANKS to Andrew Montalenti for taking on the technical editing, and, of course, the
editors at Wiley, Carol Long and Edward Connor. A special thanks to Lynn Haller: without her,
this project wouldn’t have come together. Also, PJ Cabrera for both helping me kickstart my writing
career and introducing me to jQuery.
Thanks to the Hacker Dojo for providing such an amazing coworking space, and to the dojo
members who contributed input.
I’m also grateful to my friends and family for their support and input, most notably Paul Wayland,
Alejandro Valsega, and Valerie Voigt.
—Cesar Otero
I’D LIKE TO THANK the folks at Wiley for giving me this opportunity and especially Carol Long and
Edward Connor for helping me hit the ground running. I’d be crazy not to mention our copy editor,
Kim Cofer, and Andrew Montalenti, our technical editor. Without them, we’d be working without
a spotter. Knowing they’re there to catch us when we stumble makes this a lot easier. I’d also like to
thank Renée Midrack and Lynn Haller from Studio B for steering me towards the opportunity in
the fi rst place.
I defi nitely want to thank the jQuery team and community for being generally phenomenal. Here’s a
big high five to all the great front-end engineers I’ve worked with at Cramer, Isobar, and Sapient —
thanks for pushing me to be a better programmer, manager, and colleague. From Sapient, I need to
specifically thank Jarlath Forde, Joe Morgan, and Alvin Crespo for direct support on the book.
—Rob Larsen
INTRODUCTION xv
Understanding Numbers 20
Working with Strings 21
Understanding Booleans 21
Comparison Types 22
A Brief Note About Dates 23
Reviewing Miscellaneous Types 23
Revisiting Variables 24
Understanding Objects 25
Using Functions 29
Understanding Execution Context 32
Working with Scope and Closures 32
Understanding Access Levels 34
Applying Modules 34
Using JavaScript Arrays 35
Augmenting Types 37
Applying JS Best Practices 38
Putting It All Together 38
Summary 39
Note 39
xi
xii
INDEX 305
xiii
OVER THE PAST SEVERAL YEARS JAVASCRIPT has undergone a remarkable transformation. Where
once it was a “toy” language relegated to secondary status it’s now one of the most important
programming languages in the world. With the ongoing importance of Ajax-based development and
the rise of full-featured JavaScript libraries, the stigma surrounding JavaScript has all but vanished.
As easily the most popular and beginner-friendly library, jQuery is responsible for the lion’s share of
that progress.
jQuery is more than just a beginner’s choice; however, it’s in use at some of the largest organizations
in the world, adding interactivity to billions of page views every month. Amazon, IBM, Twitter,
NBC, Best Buy and Dell are just a few of the companies using jQuery in production.
With a web-scale footprint it should come as no surprise that jQuery is evolving at web speed. 2011
saw no less than three major releases and the community surrounding jQuery continues to blossom
as developers the world over contribute bug fi xes, plugins and work on related projects like jQuery
UI and QUnit. This flurry of activity ensures that jQuery presents a full-featured option for any
developer looking to do world-class JavaScript development.
This is true no matter what programming philosophy or technique is followed: jQuery is
prominently featured in the front end of Java/Spring, PHP, .NET, Ruby on Rails, and Python/
Django stacks all over the Web.
If you have experience with HTML, CSS, and JavaScript, then this book is for you. This book
will expand your jQuery knowledge by focusing on the core library with the benefit of strong
core JavaScript expertise coloring the lessons. The fi rst few chapters will help you to set up a
development environment, and reviews important JavaScript concepts. Chapters 3 to 7 examine the
jQuery core concepts. The second half of the book focuses on applying jQuery in the real world,
detailing jQuery UI, plugin development, templates, unit testing, best practices, and JavaScript
design patterns applied with jQuery.
Hopefully, this book will give you the hardcore jQuery chops you’ll need to solve whatever
problems the Web throws at you.
This book is not aimed at beginners. For beginners looking to start from the basics of HMTL, CSS,
and JavaScript/jQuery development, Beginning JavaScript and CSS Development with jQuery
(Wrox Programmer to Programmer) by Richard York is a more appropriate choice.
xvi
CONVENTIONS
To help you get the most from the text and keep track of what’s happening, we’ve used a number of
conventions throughout the book.
xvii
Boxes with a warning icon like this one hold important, not-to-be-forgotten
information that is directly relevant to the surrounding text.
The pencil icon indicates notes, tips, hints, tricks, and asides to the current
discussion.
We use bold to emphasize code that is particularly important in the present context
or to show changes from a previous code snippet.
SOURCE CODE
As you work through the examples in this book, you may choose either to type in all the code
manually, or to use the source code fi les that accompany the book. All the source code used in this
book is available for download at www.wrox.com. When at the site, simply locate the book’s title
(use the Search box or one of the title lists) and click the Download Code link on the book’s detail
page to obtain all the source code for the book. Code that is included on the website is highlighted
by the following icon:
Available for
download on
Wrox.com
Listings include the fi lename in the title. If it is just a code snippet, you’ll fi nd the fi lename in a code
note such as this:
Code snippet filename
Because many books have similar titles, you may fi nd it easiest to search by
ISBN; this book’s ISBN is 978-1-118-02668-7.
xviii
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or
expense to the user, provide a copy, a means of exporting a copy, or
a means of obtaining a copy upon request, of the work in its original
“Plain Vanilla ASCII” or other form. Any alternate format must
include the full Project Gutenberg™ License as specified in
paragraph 1.E.1.
• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
1.F.4. Except for the limited right of replacement or refund set forth
in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.
Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookultra.com