Beyond jQuery (The Book + 1 free "code hand" laptop sticker)
Beyond jQuery
Free yourself from the chains of jQuery by discovering the power of JavaScript and the modern web API
About the Book
Recently published by Apress. Order a copy on Amazon.
jQuery seems to be mindlessly injected into the vast majority of web applications and libraries. In some cases, there there may be no logical reason for pulling in jQuery as a dependency. For example: a library that only needs to perform a few simple element selections or DOM manipulations. Many web developers don’t really know when they need to use jQuery, and when they don’t. Pulling in this dependency seems to be a standard step when setting up a new library or web application. You shouldn’t be a jQuery developer, you should be a web developer, and part of being an effective web developer is a firm grasp on the underpinnings of web development.
Surprisingly, while browsers and JavaScript have improved significantly, the use of jQuery on the web has actually grown. It is surprisingly common to learn jQuery first, and JavaScript along with the web API much later on (and sometimes not at all). Relying solely on jQuery as your window to the web leaves large gaps in your knowledge. This in turn results in frustration when the abstraction that jQuery provides “leaks” and exposes you to the native aspects of the browser. In some cases, jQuery is ill-equipped to solve problems (such as file uploading). In these instances, those insistent on working exclusively through a library struggle as they do not have the knowledge or confidence to deal directly with the native browser API.
In addition to being unnecessary in many instances, jQuery may adversely affect the performance of your project (sometimes significantly). Even something as simple as $(element).hide() has unexpected and serious performance implications. “Beyond jQuery” aims to educate developers, reveal the magic behind jQuery, help them solve common problems without it, and give them more confidence to abandon their crutch and embrace the power of the web API and standardized JavaScript.
Reader Testimonials

Robert DiBlasi
What makes Ray's approach interesting is the way he frames the discussion of "software developer" over "library integrator" or "jQuery programmer". Libraries & frameworks are just tools. Once you know the fundamentals, then you can make smart choices about why & when you might make use of such tools. You have options as a developer. "Beyond jQuery" has a very easy to read style. I like the way Ray gives confidence to the reader that they can use JavaScript instead of a library like jQuery.
Table of Contents
-
- Acknowledgments
- Preface
- Introduction
-
I The Oppressive Magic of jQuery
-
1. Why have we been using jQuery?
- 1.1 Simplicity
- 1.2 Community
- 1.3 Habit
- 1.4 Elegance
- 1.5 Fear
-
2. A crutch is only temporary
- 2.1 You are a mechanic, not a driver
- 2.2 Stunted growth
-
3. The price of shortcuts (a true story)
- 3.1 A new direction, a new web developer
- 3.2 Shortcuts and my own stunted growth
- 3.3 A challenge – no jQuery allowed!
- 4. Focus on the implementation, not the magic
-
1. Why have we been using jQuery?
-
II You Don’t Need jQuery (anymore)
- 5. Need vs. want
-
6. Both sides of the acceptable use argument
- 6.1 When is it acceptable to use it?
- 6.2 When should you refrain from using it?
-
7. Should you use other libraries instead?
- 7.1 Small shims over large wrappers
- 7.2 Writing your own shim
- 8. The final word
-
III Understanding the Web API & “Vanilla” JavaScript
-
9. Everything you need to know about browsers
- 9.1 Ancient browsers
- 9.2 Modern browsers
- 9.3 Evergreen browsers
- 9.4 Mobile browsers
- 9.5 Non-browsers
-
10. What is this “web API” and why is it important?
- 10.1 The DOM API
- 10.2 Everything else (non-DOM)
-
11. JavaScript: A Less Elegant Version of jQuery?
- 11.1 The language versus the web API
- 11.2 History and standardization
-
9. Everything you need to know about browsers
-
IV Finding HTML Elements
-
12. Core element selectors
-
12.1 IDs
- 12.1.1 jQuery
- 12.1.2 Web API
-
12.2 Classes
- 12.2.1 jQuery
- 12.2.2 Web API
-
12.3 Element tags
- 12.3.1 jQuery
- 12.3.2 Web API
-
12.4 Pseduo-classes
- 12.4.1 jQuery
- 12.4.2 Web API
-
12.1 IDs
-
13. Selecting elements based on their relations
-
13.1 Parents and children
- 13.1.1 jQuery
- 13.1.2 Web API
-
13.2 Siblings
- 13.2.1 jQuery
- 13.2.2 Web API
-
13.3 Ancestors and descendants
- 13.3.1 jQuery
- 13.3.2 Web API
-
13.1 Parents and children
-
14. Mastering advanced element selection
-
14.1 Excluding elements
- 14.1.1 jQuery
- 14.1.2 Web API
-
14.2 Multiple selectors
- 14.2.1 jQuery
- 14.2.2 Web API
- 14.3 Element categories and modifiers
-
14.1 Excluding elements
- 15. A simple replacement for $(selector)
-
12. Core element selectors
-
V Using and Understanding HTML Element Attributes
-
16. What is an attribute?
- 16.1 History and standardization
- 16.2 How do attributes differ from properties?
-
17. Finding elements using attributes
-
17.1 Finding elements using attribute names
- 17.1.1 jQuery
- 17.1.2 Web API
-
17.2 Finding elements using attribute names and values
- 17.2.1 jQuery
- 17.2.2 Web API
-
17.3 The power of wildcard and fuzzy attribute selectors
- 17.3.1 Looking for specific characters
- 17.3.2 Looking for specific words
- 17.3.3 Attribute values that start or end with…
-
17.1 Finding elements using attribute names
-
18. Reading and modifying element attributes
-
18.1 Class attributes
- 18.1.1 Reading classes
- 18.1.2 Adding and removing classes
- 18.1.3 Toggling classes
- 18.2 Data attributes
-
18.3 Working with other standard & custom attributes
- 18.3.1 Reading attributes
- 18.3.2 Modifying attributes
-
18.1 Class attributes
-
16. What is an attribute?
-
VI HTML Element Data Storage and Retrieval
-
19. Why would you want to attach data to elements?
- 19.1 Tracking state
- 19.2 Connecting elements
- 19.3 Storing models directly in your elements
-
20. Common pitfalls of pairing data with elements
- 20.1 Memory leaks
- 20.2 Managing data
-
21. Using a solution for all browsers
-
21.1 Storing small bits of data using
data-
attributes-
21.1.1 Reading and updating
data-
attributes with jQuery -
21.1.2 Using the web API to read and update
data-
attributes
-
21.1.1 Reading and updating
-
21.2 Complex element data storage and retrieval
- 21.2.1 The familiar jQuery approach
-
21.2.2 Using a more natural approach
- 21.2.2.1 Removing data from our cache when elements are removed from the DOM
-
21.1 Storing small bits of data using
-
22. The future of element data
-
22.1 The HTML5
dataset
property -
22.2 Leveraging ES6
WeakMap
collections
-
22.1 The HTML5
-
19. Why would you want to attach data to elements?
-
VII Styling Elements
-
23. There are three ways to style elements
- 23.1 Inline styles
-
23.2 Working with styles directly on the
Element
object - 23.3 Stylesheets
-
24. Getting and setting generalized styles
- 24.1 Using jQuery
- 24.2 Without jQuery
-
25. Setting and determining element visibility
- 25.1 The typical jQuery approach
- 25.2 The native web approach
-
26. Determining width and height of any element
- 26.1 Examining an element using jQuery
-
26.2 Options natively provided by the browser
- 26.2.1 Width & height of content + padding
- 26.2.2 Width & height of content + padding + border
-
23. There are three ways to style elements
-
VIII DOM Manipulation
-
27. The DOM: A central component of web development
- 27.1 jQuery exists because of the DOM API
- 27.2 The DOM API isn’t broken, it’s just misunderstood
-
28. Moving and copying elements
-
28.1 Moving elements around the DOM
- 28.1.1 Moving elements using jQuery
- 28.1.2 The DOM API’s solution to reordering elements
- 28.2 Making copies of elements
-
28.1 Moving elements around the DOM
-
29. Composing your own elements
- 29.1 Creating and deleting elements
- 29.2 Text content
- 29.3 Rich content
-
27. The DOM: A central component of web development
-
IX Ajax Requests: Dynamic Data and Page Updates
-
30. Mastering the concepts of ajax communication
- 30.1 Async is hard
- 30.2 HTTP
- 30.3 Expected and unexpected responses
- 30.4 Web Sockets
-
31. Sending GET, POST, DELETE, PUT, and PATCH requests
- 31.1 Sending POST requests
- 31.2 Sending PUT requests
- 31.3 Sending DELETE requests
- 31.4 Sending PATCH requests
-
32. Encoding requests and reading encoded responses
- 32.1 URL encoding
- 32.2 JSON encoding
- 32.3 Multipart encoding
-
33. Uploading and manipulating files
- 33.1 Uploading files in ancient browsers
- 33.2 Uploading files in modern browsers
- 33.3 Reading and creating files
-
34. Cross-domain communication: an important topic
- 34.1 The early days (JSONP)
- 34.2 Modern times (CORS)
-
30. Mastering the concepts of ajax communication
-
X Browser Events
-
35. How do events work?
- 35.1 Event types: Custom, and native
- 35.2 Event propagation: Bubbling vs capturing
-
36. Creating and firing DOM events
- 36.1 Firing DOM events with jQuery
- 36.2 Web API DOM events
-
37. Creating and firing custom events
- 37.1 jQuery custom events
- 37.2 Firing custom events with the web API
-
38. Listening (and un-listening) to event notifications
- 38.1 jQuery event handlers
- 38.2 Observing events with the web API
- 39. Controlling event propagation
- 40. Passing data to event handlers
- 41. Event delegation: powerful and underused
-
42. Handling and triggering keyboard events
- 42.1 3 types of keyboard events
- 42.2 Identifying pressed keys
- 42.3 Making an image carousel keyboard accessible with the web API
-
43. Determining when something has loaded
- 43.1 When have all elements on the page fully loaded and rendered w/ applied styles?
- 43.2 When has all static markup been placed on the page?
- 43.3 When has a particular element on the page fully loaded? When has it failed to load?
- 43.4 Preventing a user from accidentally leaving the current page
-
44. A history lesson: Ancient browser support
- 44.1 The API for listening to events is non-standard
- 44.2 Form field change events are a minefield
-
44.3 The
Event
object is also non-standard
-
35. How do events work?
-
XI Mastering Asynchronous Tasks
-
45. Callbacks: The traditional approach for controlling async operations
- 45.1 Node.js & the error-first callback
- 45.2 Solving common problems with callbacks
-
46. Promises: An answer to async complexity
- 46.1 The first standardized way to harness async
-
46.2 Using Promises to simplify async operations
-
46.2.1 The anatomy of a
Promise
-
46.2.2 Simple
Promise
examples - 46.2.3 Fixing “callback hell” with promises
- 46.2.4 Monitoring multiple related async tasks with promises
-
46.2.1 The anatomy of a
- 46.3 jQuery’s broken promise implementation
- 46.4 Native browser support
-
47. Async functions: An abstraction for async tasks
- 47.1 The problem with promises
- 47.2 Async functions to the rescue
- 47.3 Browser support
- 48. The future of standardized async task handling
-
45. Callbacks: The traditional approach for controlling async operations
-
XII Common JavaScript Utility Functions
-
49. Working with dates, text, XML, and JSON
- 49.1 Dates
- 49.2 Converting JSON into a JavaScript object
- 49.3 Converting an XML string into a document
- 49.4 String manipulation
-
50. What kind of value is this?
- 50.1 Primitives
- 50.2 Arrays
- 50.3 Objects
- 50.4 Functions
-
51. Making JavaScript Objects bend to your will
- 51.1 Iterating over keys and values
- 51.2 Copying and merging objects
-
52. Solving problems with Arrays
- 52.1 Iterating over array items
- 52.2 Locating specific items
- 52.3 Managing pseudo-arrays
- 52.4 Mapping and merging
-
53. Useful
function
tricks- 53.1 A word about JavaScript context
- 53.2 Creating a new function from an old one
- 53.3 Calling an existing function with a new context
-
49. Working with dates, text, XML, and JSON
- About the Author
- Notes
Authors have earned$10,261,184writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.
Learn more about writing on Leanpub
The Leanpub 45-day 100% Happiness Guarantee
Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
Top Books
C++20
Rainer GrimmC++20 is the next big C++ standard after C++11. As C++11 did it, C++20 changes the way we program modern C++. This change is, in particular, due to the big four of C++20: ranges, coroutines, concepts, and modules.
500 QUIZ MMG COMMENTATI
ALS Medicina Generale500 Quiz degli ULTIMI Concorsi di Medicina Generale (2014/2016/2017/2018/2019)
Riassunti e suddivisi per area con Griglia risposte vuota e Griglia risposte esatte Ministeriale
Commentati con link alla fonte per approfondimento e ausilio allo studio
R Programming for Data Science
Roger D. PengThis book brings the fundamentals of R programming to you, using the same material developed as part of the industry-leading Johns Hopkins Data Science Specialization. The skills taught in this book will lay the foundation for you to begin your journey learning data science. Printed copies of this book are available through Lulu.
Ansible for DevOps
Jeff GeerlingAnsible is a simple, but powerful, server and configuration management tool. Learn to use Ansible effectively, whether you manage one server—or thousands.
Atomic Kotlin
Bruce Eckel and Svetlana IsakovaFor both beginning and experienced programmers! From the author of the multi-award-winning Thinking in C++ and Thinking in Java together with a member of the Kotlin language team comes a book that breaks the concepts into small, easy-to-digest "atoms," along with exercises supported by hints and solutions directly inside IntelliJ IDEA!
Continuous Delivery Pipelines
Dave FarleyThis practical handbook provides a step-by-step guide for you to get the best continuous delivery pipeline for your software.
C++ Best Practices
Jason TurnerLevel up your C++, get the tools working for you, eliminate common problems, and move on to more exciting things!
Visualise, document and explore your software architecture
Simon BrownA short guide to visualising, documenting and exploring your software architecture.
Discrete Mathematics for Computer Science
Alexander Shen, Alexander S. Kulikov, Vladimir Podolskii, and Aleksandr GolovnevThis book supplements the DM for CS Specialization at Coursera and contains many interactive puzzles, autograded quizzes, and code snippets. They are intended to help you to discover important ideas in discrete mathematics on your own. By purchasing the book, you will get all updates of the book free of charge when they are released.
Functional Design and Architecture
Alexander GraninSoftware Design in Functional Programming, Design Patterns and Practices, Methodologies and Application Architectures. How to build real software in Haskell with less efforts and low risks. The first complete source of knowledge.
Top Bundles
- #1
Software Architecture for Developers: Volumes 1 & 2 - Technical leadership and communication
2 Books
"Software Architecture for Developers" is a practical and pragmatic guide to modern, lightweight software architecture, specifically aimed at developers. You'll learn:The essence of software architecture.Why the software architecture role should include coding, coaching and collaboration.The things that you really need to think about before... - #2
Software Architecture and Design Practice Reference
2 Books
Dive deeper in Software Architecture with the Design Practice Reference. Learn all about software architecture and design from the books in this bundle:Software Architecture covers topics from quality attributes to designing and modeling components, interfaces, connectors, and containers, all the way to services and microservices. The Design... - #6
Linux Administration Complet
4 Books
Ce lot comprend les quatre volumes du Guide Linux Administration :Linux Administration, Volume 1, Administration fondamentale : Guide pratique de préparation aux examens de certification LPIC 1, Linux Essentials, RHCSA et LFCS. Administration fondamentale. Introduction à Linux. Le Shell. Traitement du texte. Arborescence de fichiers. Sécurité... - #7
The Python Craftsman
3 Books
The Python Craftsman series comprises The Python Apprentice, The Python Journeyman, and The Python Master. The first book is primarily suitable for for programmers with some experience of programming in another language. If you don't have any experience with programming this book may be a bit daunting. You'll be learning not just a programming... - #8
All the Books of The Medical Futurist
6 Books
We put together the most popular books from The Medical Futurist to provide a clear picture about the major trends shaping the future of medicine and healthcare. Digital health technologies, artificial intelligence, the future of 20 medical specialties, big pharma, data privacy, digital health investments and how technology giants such as Amazon... - #10
Mastering Containers
2 Books
Docker and Kubernetes are taking the world by storm! These books will get you up-to-speed fast! Docker Deep Dive is over 400 pages long, and covers all objectives on the Docker Certified Associate exam.The Kubernetes Book includes everything you need to get up and running with Kubernetes!