jQuery Design Patterns

Learn the best practices on writing efficient jQuery applications to maximize performance in large-scale deployments
Preview in Mapt

jQuery Design Patterns

Thodoris Greasidis

2 customer reviews
Learn the best practices on writing efficient jQuery applications to maximize performance in large-scale deployments
Mapt Subscription
FREE
$29.99/m after trial
eBook
$10.00
RRP $31.99
Save 68%
Print + eBook
$39.99
RRP $39.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$10.00
$39.99
$29.99 p/m after trial
RRP $31.99
RRP $39.99
Subscription
eBook
Print + eBook
Start 14 Day Trial

Frequently bought together


jQuery Design Patterns Book Cover
jQuery Design Patterns
$ 31.99
$ 10.00
JavaScript: Functional Programming for JavaScript Developers Book Cover
JavaScript: Functional Programming for JavaScript Developers
$ 63.99
$ 10.00
Buy 2 for $20.00
Save $75.98
Add to Cart

Book Details

ISBN 139781785888687
Paperback246 pages

Book Description

jQuery is a feature-rich JavaScript library that makes HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a variety of browsers. With a combination of versatility and extensibility, jQuery has changed the way that millions of people write JavaScript.

jQuery solves the problems of DOM manipulation, event detection, AJAX calls, element selection and document queries, element attribute and data management, as well as object management utilities. This book addresses these problems and shows you how to make the best of jQuery through the various design patterns available.

The book starts off with a refresher to jQuery and will then take you through the different design patterns such as facade, observer, publisher/subscriber, and so on. We will also go into client-side templating techniques and libraries, as well as some plugin development patterns. Finally, we will look into some best practices that you can use to make the best of jQuery.

Table of Contents

Chapter 1: A Refresher on jQuery and the Composite Pattern
jQuery and DOM scripting
The Composite Pattern
The Iterator Pattern
Summary
Chapter 2: The Observer Pattern
Introducing the Observer Pattern
Introducing the Delegated Event Observer Pattern
Summary
Chapter 3: The Publish/Subscribe Pattern
Introducing the Publish/Subscribe Pattern
How it is adopted by jQuery
Demonstrating a sample use case
Using custom event namespacing
Summary
Chapter 4: Divide and Conquer with the Module Pattern
Modules and Namespaces
The Object Literal Pattern
The Module Pattern
The Revealing Module Pattern
Using ES5 Strict Mode
Introducing ES6 Modules
Using Modules in jQuery applications
Summary
Chapter 5: The Facade Pattern
Introducing the Facade Pattern
The benefits of this pattern
How it is adopted by jQuery
Using Facades in our applications
Summary
Chapter 6: The Builder and Factory Patterns
Introducing the Factory Pattern
Introducing the Builder Pattern
Summary
Chapter 7: Asynchronous Control Flow Patterns
Programming with callbacks
Introducing the concept of Promises
Chaining Promises
Summary
Chapter 8: Mock Object Pattern
Introducing the Mock Object Pattern
Using Mock Objects in jQuery applications
Summary
Chapter 9: Client-side Templating
Introducing Underscore.js
Introducing Handlebars.js
Retrieving HTML templates asynchronously
Summary
Chapter 10: Plugin and Widget Development Patterns
Introducing jQuery Plugins
Creating reusable plugins
Using the jQuery Plugin Boilerplate
Choosing a name
Summary
Chapter 11: Optimization Patterns
Placing scripts near the end of the page
Bundling and minifying resources
Using CDNs
Optimizing common JavaScript code
Writing performant CSS selectors
Writing efficient jQuery code
Lazy Loading Modules
Summary

What You Will Learn

  • Respond to user actions
  • Achieve greater flexibility and code decoupling
  • Have a central point for emitting and receiving application level events
  • Structure the application into small independent modules
  • Abstract complex APIs
  • Isolate the procedure of generating complex parts of the application
  • Efficiently orchestrate asynchronous procedures using jQuery Deferred and Promises
  • Utilize the most widely-used client-side templating libraries for more complex use cases

Authors

Table of Contents

Chapter 1: A Refresher on jQuery and the Composite Pattern
jQuery and DOM scripting
The Composite Pattern
The Iterator Pattern
Summary
Chapter 2: The Observer Pattern
Introducing the Observer Pattern
Introducing the Delegated Event Observer Pattern
Summary
Chapter 3: The Publish/Subscribe Pattern
Introducing the Publish/Subscribe Pattern
How it is adopted by jQuery
Demonstrating a sample use case
Using custom event namespacing
Summary
Chapter 4: Divide and Conquer with the Module Pattern
Modules and Namespaces
The Object Literal Pattern
The Module Pattern
The Revealing Module Pattern
Using ES5 Strict Mode
Introducing ES6 Modules
Using Modules in jQuery applications
Summary
Chapter 5: The Facade Pattern
Introducing the Facade Pattern
The benefits of this pattern
How it is adopted by jQuery
Using Facades in our applications
Summary
Chapter 6: The Builder and Factory Patterns
Introducing the Factory Pattern
Introducing the Builder Pattern
Summary
Chapter 7: Asynchronous Control Flow Patterns
Programming with callbacks
Introducing the concept of Promises
Chaining Promises
Summary
Chapter 8: Mock Object Pattern
Introducing the Mock Object Pattern
Using Mock Objects in jQuery applications
Summary
Chapter 9: Client-side Templating
Introducing Underscore.js
Introducing Handlebars.js
Retrieving HTML templates asynchronously
Summary
Chapter 10: Plugin and Widget Development Patterns
Introducing jQuery Plugins
Creating reusable plugins
Using the jQuery Plugin Boilerplate
Choosing a name
Summary
Chapter 11: Optimization Patterns
Placing scripts near the end of the page
Bundling and minifying resources
Using CDNs
Optimizing common JavaScript code
Writing performant CSS selectors
Writing efficient jQuery code
Lazy Loading Modules
Summary

Book Details

ISBN 139781785888687
Paperback246 pages
Read More
From 2 reviews

Read More Reviews

Recommended for You

JavaScript: Functional Programming for JavaScript Developers Book Cover
JavaScript: Functional Programming for JavaScript Developers
$ 63.99
$ 10.00
JavaScript: Functional Programming for JavaScript Developers Book Cover
JavaScript: Functional Programming for JavaScript Developers
$ 63.99
$ 10.00
Learning Vue.js 2 Book Cover
Learning Vue.js 2
$ 35.99
$ 10.00
HTML5 and CSS3: Building Responsive Websites Book Cover
HTML5 and CSS3: Building Responsive Websites
$ 67.99
$ 10.00
Spring: Developing Java Applications for the Enterprise Book Cover
Spring: Developing Java Applications for the Enterprise
$ 67.99
$ 10.00
Architecting Modern Java EE Applications Book Cover
Architecting Modern Java EE Applications
$ 39.99
$ 10.00