(Ebook) Learning jQuery 3 - Build interesting, interactive sites using jQuery by automating common tasks and simplifying the complicated ones (2017,5e) by by Adam Boduch; Jonathan Chaffer; Karl Swedberg; [Boduch, Adam; Chaffer, Jonathan; Swedberg, Karl] ISBN 9781785882982, 1785882988 download pdf
(Ebook) Learning jQuery 3 - Build interesting, interactive sites using jQuery by automating common tasks and simplifying the complicated ones (2017,5e) by by Adam Boduch; Jonathan Chaffer; Karl Swedberg; [Boduch, Adam; Chaffer, Jonathan; Swedberg, Karl] ISBN 9781785882982, 1785882988 download pdf
com
DOWLOAD EBOOK
https://ebooknice.com/product/learning-jquery-1-3-1266146
ebooknice.com
https://ebooknice.com/product/learning-jquery-third-edition-2395766
ebooknice.com
https://ebooknice.com/product/learning-jquery-4380222
ebooknice.com
(Ebook) Learning jQuery: Better Interaction Design and Web
Development with Simple Javascript Techniques by Jonathan
Chaffer, Karl Swedberg ISBN 9781847192509, 1847192505
https://ebooknice.com/product/learning-jquery-better-interaction-
design-and-web-development-with-simple-javascript-techniques-983158
ebooknice.com
ebooknice.com
ebooknice.com
https://ebooknice.com/product/piano-adventures-performance-3b-52393612
ebooknice.com
Title Page
Learning jQuery 3
Fifth Edition
BIRMINGHAM - MUMBAI
https://avxhm.se/blogs/AlenMiler
Copyright
Learning jQuery 3
Fifth Edition
Copyright © 2017 Packt Publishing
Every effort has been made in the preparation of this book to ensure
the accuracy of the information presented. However, the information
contained in this book is sold without warranty, either express or
implied. Neither the authors, nor Packt Publishing, and its dealers
and distributors will be held liable for any damages caused or
alleged to be caused directly or indirectly by this book.
ISBN 978-1-78588-298-2
www.packtpub.com
https://avxhm.se/blogs/AlenMiler
Credits
Authors
Karl Swedberg
I'd like to thank John Resig for creating jQuery, and I'd like to thank
the collective jQuery community for making such a positive impact
on web development.
Did you know that Packt offers eBook versions of every book
published, with PDF and ePub files available? You can upgrade to the
eBook version at www.PacktPub.comand as a print book customer, you
are entitled to a discount on the eBook copy. Get in touch with us
at service@packtpub.com for more details.
https://www.packtpub.com/mapt
Get the most in-demand software skills with Mapt. Mapt gives you
full access to all Packt books and video courses, as well as industry-
leading tools to help you plan your personal development and
advance your career.
Why subscribe?
Fully searchable across every book published by Packt
Copy and paste, print, and bookmark content
On demand and accessible via a web browser
Customer Feedback
Thanks for purchasing this Packt book. At Packt, quality is at the
heart of our editorial process. To help us improve, please leave us an
honest review on this book's Amazon page at https://www.amazon.com/
dp/1785882988.
If you'd like to join our team of regular reviewers, you can e-mail us
at customerreviews@packtpub.com. We award our regular reviewers with
free eBooks and videos in exchange for their valuable feedback. Help
us be relentless in improving our products!
Dedication
For Melissa, Jason, Simon, and Kevin. Thanks for all the
love and support.
Table of Contents
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Getting Started
What jQuery does?
Why jQuery works well?
What's new in jQuery 3?
Browser support
Deferred objects
Asynchronous document-ready
All the rest
Making our first jQuery-powered web page
Downloading jQuery
Setting up jQuery in an HTML document
Adding our jQuery code
Finding the poem text
Injecting the new class
Executing the code
The finished product
Plain JavaScript versus jQuery
Using development tools
Chrome Developer Tools
Summary
2. Selecting Elements
Understanding the DOM
Using the $() function
CSS selectors
Styling list-item levels
Selector specificity
Attribute selectors
Styling links
Custom selectors
Styling alternate rows
Finding elements based on textual content
Form selectors
DOM traversal methods
Styling specific cells
Chaining
Iterating over jQuery objects
Accessing DOM elements
Summary
Further reading
Exercises
3. Handling Events
Performing tasks on page load
Timing of code execution
Handling multiple scripts on one page
Passing an argument to the document ready callback
Handling simple events
A simple style switcher
Enabling the other buttons
Making use of event handler context
Consolidating code using event context
Shorthand events
Showing and hiding page elements
Event propagation
The journey of an event
Side effects of event bubbling
Altering the journey - the event object
Event targets
Stopping event propagation
Preventing default actions
Delegating events
Using built-in event delegation capabilities
Removing an event handler
Giving namespaces to event handlers
Rebinding events
Simulating user interaction
Reacting to keyboard events
Summary
Further reading
Exercises
4. Styling and Animating
Modifying CSS with inline properties
Setting computed style property values
Using vendor-specific style properties
Hiding and showing elements
Effects and duration
Speeding in
Fading in and fading out
Sliding up and sliding down
Toggling visibility
Creating custom animations
Building effects by hand
Animating multiple properties at once
Positioning with CSS
Simultaneous versus queued effects
Working with a single set of elements
Bypassing the queue
Queuing effects manually
Working with multiple sets of elements
Queuing with callbacks
In a nutshell
Summary
Further reading
Exercises
5. Manipulating the DOM
Manipulating attributes and properties
Non-class attributes
Value callbacks
Data attributes
DOM element properties
The value of form controls
DOM tree manipulation
The $() function revisited
Creating new elements
Inserting new elements
Moving elements
Wrapping elements
Explicit iteration
Using inverted insertion methods
Copying elements
Cloning for pull quotes
Content getter and setter methods
DOM manipulation methods in a nutshell
Summary
Further reading
Exercises
6. Sending Data with Ajax
Loading data on demand
Appending HTML
Working with JavaScript objects
Retrieving JSON
Using global jQuery functions
Executing a script
Loading an XML document
Choosing a data format
Passing data to the server
Performing a GET request
Serializing a form
Keeping an eye on the request
Error handling
Ajax and events
Deferreds and promises
Performing Ajax calls on page load
Using fetch()
Summary
Further reading
Exercises
7. Using Plugins
Using a plugin
Downloading and referencing the Cycle plugin
Calling a plugin method
Specifying plugin method parameters
Modifying parameter defaults
Other types of plugins
Custom selectors
Global function plugins
The jQuery UI plugin library
Effects
Color animations
Class animations
Advanced easing
Additional effects
Interaction components
Widgets
jQuery UI ThemeRoller
The jQuery Mobile plugin library
HTML5 custom data attributes
Mobile navigation
Delivering multiple pages in one document
Interactive elements
List views
Toolbar buttons
Advanced features
Summary
Exercises
8. Developing Plugins
Using the dollar ($) alias in plugins
Adding new global functions
Adding multiple functions
Extending the global jQuery object
Isolating functions within namespaces
Adding jQuery object methods
Object method context
Implicit iteration
Enabling method chaining
Providing flexible method parameters
Options objects
Default parameter values
Callback functions
Customizable defaults
Creating plugins with the jQuery UI widget factory
Creating a widget
Destroying widgets
Enabling and disabling widgets
Accepting widget options
Adding methods
Triggering widget events
Plugin design recommendations
Distributing a plugin
Summary
Exercises
9. Advanced Selectors and Traversing
Selecting and traversing revisited
Dynamic table filtering
Striping table rows
Combining filtering and striping
More selector and traversal methods
Customizing and optimizing selectors
Writing a custom selector plugin
Selector performance
Sizzle selector implementation
Testing selector speed
DOM traversal under the hood
jQuery traversal properties
The DOM element stack
Writing a DOM traversal method plugin
DOM traversal performance
Improving performance using chaining
Improving performance with caching
Summary
Further reading
Exercises
10. Advanced Events
Revisiting events
Loading additional pages of data
Displaying data on hover
Event delegation
Using jQuery's delegation capabilities
Choosing a delegation scope
Delegating early
Defining custom events
Infinite scrolling
Custom event parameters
Throttling events
Other ways to perform throttling
Extending events
More about special events
Summary
Further reading
Exercises
11. Advanced Effects
Animation revisited
Observing and interrupting animations
Determining the animation state
Halting a running animation
Caution when halting animations
Using global effect properties
Disabling all effects
Defining effect durations
Multi-property easing
Using deferred objects
Animation promises
Taking fine-grained control of animations
Summary
Further reading
Exercises
12. Advanced DOM Manipulation
Sorting table rows
Sorting tables on the server
Sorting tables using Ajax
Sorting tables within the browser
Moving and inserting elements revisited
Adding links around existing text
Sorting simple JavaScript arrays
Sorting DOM elements
Storing data alongside DOM elements
Performing additional pre-computation
Storing non-string data
Alternating sort directions
Using HTML5 custom data attributes
Sorting and building rows with JSON
Modifying the JSON object
Rebuilding content on demand
Revisiting attribute manipulation
Using shorthand element creation syntax
DOM manipulation hooks
Writing a CSS hook
Summary
Further reading
Exercises
13. Advanced Ajax
Implementing progressive enhancement with Ajax
Harvesting JSONP data
Handling Ajax errors
Using the jqXHR object
Ajax promises
Caching responses
Throttling Ajax requests
Extending Ajax capabilities
Data type converters
Adding Ajax prefilters
Defining alternate transports
Summary
Further reading
Exercises
Appnedix A – Testing JavaScript with QUnit
Downloading QUnit
Setting up the document
Organizing tests
Adding and running tests
Asynchronous testing
Other types of tests
Practical considerations
Further reading
Summary
Appendix B – Quick Reference
Selector expressions
Simple CSS
Position among siblings
Position among matched elements
Attributes
Forms
Miscellaneous selectors
DOM traversal methods
Filtering
Descendants
Siblings
Ancestors
Collection manipulation
Working with selected elements
Event methods
Binding
Shorthand binding
Triggering
Shorthand triggering
Utility
Effect methods
Predefined effects
Custom animations
Queue manipulation
DOM manipulation methods
Attributes and properties
Content
CSS
Dimensions
Insertion
Replacement
Removal
Copying
Data
Ajax methods
Issuing requests
Request monitoring
Configuration
Utilities
Deferred objects
Object creation
Methods of deferred objects
Methods of promise objects
Miscellaneous properties and functions
Properties of the jQuery object
Arrays and objects
Object introspection
Other
Preface
I started using jQuery in 2007, and I'm still using it today. Granted, a
lot has happened between now and then: new JavaScript libraries,
more consistency across browsers, and enhancements to JavaScript
itself. The one thing that hasn't changed in 10 years is the
expressiveness and conciseness of jQuery. Even with all the new
hotness out there today, jQuery remains the go-to tool of choice for
getting work done quickly, and efficiently.
This book has a long history behind it, and it remains intact in its
fifth edition. It has been a successful book because it is straight to
the point and easy to follow. I've done my best to preserve what has
worked so well for this book. My goal is to modernize learning
jQuery for the current web-development landscape.
What this book covers
Chapter 1,Getting Started, gets your feet wet with the jQuery
JavaScript library. The chapter begins with a description of jQuery
and what it can do for you. It then walks you through downloading
and setting up the library as well as writing your first script.
Chapter 11, Advanced Effects, shows you how to fine-tune the visual
effects of jQuery that can be provided by crafting custom-easing
functions and reacting to each step of an animation. You'll gain the
ability to manipulate animations as they occur and schedule actions
with custom queuing.
Again the low whistle is heard, and this time it sounds just
beneath his window. How was it that Chance and Laddie did
not begin to bark until the first whistle was heard? It must
have been the snow that muffled the tread of that stealthy
foot. They are barking furiously now! But Miles, flinging
open the casement, bids them be still; and unwillingly they
drop into sullen silence, broken at times by a low,
protesting growl.
"Send away your dogs, or I'll finish them right out," said the
voice uneasily from below.
"You have got the old fox in there. Now that he has run to
earth, I say keep him there."
"I can't keep him here, unless the snow stops the hole for
you," was the troubled reply.
"Yes; and you think to be his guide. You are going to try
your mean hand at the informer's trade; for it is always the
chief rogue that turns king's evidence," said Tim o' the
Brooms, with an insulting sneer.
"I'm going to do naught of the kind," said Miles, "but the old
man shall go his own gait. He has always been a friend of
the family, like—my dead father's friend; and nothing shall
harm him."
"Very well, as you like," was the cool reply: "then the stock
must be shifted before morning; that's all."
"Stay, where will you be putting it? I will know that," cried
Miles.
"Oh, it's all ready planned. We've got a safe hiding in view.
The scent will be hard up at somebody else's door. 'Twill be
a good joke, too, to catch the psalm-singers up at Scarf
Beck in a trap. But that's your concern, not mine."
"I'll not have that done, whatever else may be," cried Miles,
with burning cheek and clenched fist. "I'd sooner die than
any of them should be harmed. There shall not a breath stir
against any one belonging to—to—the folk up at Scarf
Beck."
The man sneered offensively, and said, "I know how the
land lies well enough. But if you don't bring your cart
tonight, and help us to shift right off, 'over sands,' * we'll
move all the whisky jars into the old barn at Scarf Beck;
and we'll see if anybody will believe the Hartley lads when
they swear they didn't put them there." So saying, Tim o'
the Brooms glided noiselessly away over the snow.
The moon was now shining steadily upon the scene, and the
snow had ceased falling; but it lay so deep upon all around,
that the usual tracks were obliterated.
He opened the door, and listened: all was quiet, except that
the clock ticked on the stairs in its own measured way, and
he started when it struck three, as he glided past it with
shoeless feet. He found his black-and-white shepherd's plaid
wrapper hanging on the pin in the kitchen, and he threw it
around him in the approved mountain fashion, whereby it
forms a good protection for chest and shoulders, while
sufficient freedom is left for the arms. He then put on a
stout pair of boots, drew on his warm worsted gloves, tied
Alice's "comforter" round his neck, and taking his stout
staff, opened the door.
The porch was floored with snow: the walk was a shining
sheet of white: Alice's pet plants were buried, or else
feathered into white and drooping plumes: the brother yews
were bending under masses of snow: the little wicket stood
like bars of alabaster before him; and rather than break the
shining spell, he vaulted lightly over it.
And still he struggled on. Oh, the weariness and the weight!
the weariness of dragging his limbs out of the deepening
snows, the weight of the aching limbs as he plunged them
into fresh wreaths and took the soundings of new depths.
CHAPTER IV.
THE SEARCH.
"Yes," said Mat, "so far as I know. He was in last night. But
he's lying late this morning;" and away they went to dig out
some of their sheep, which had been buried in the drifts of
the night.
No answer.
She opened the door and he was not there. There was the
bed just as her own careful hands had left the sheet neatly
turned down, and the pillow round and smooth. The
casement was not quite closed, and there was a little bank
of snow lying on the windowsill.
A single glance showed her all this, and she rushed down to
the kitchen in consternation "Oh, Mark! he isn't there; and
his bed is all untouched. He must have gone out—and oh I
think of the snow."
"I will," was her firm reply; but when she saw him silently
making ready to set forth, her heart misgave her; and going
up to him, she said pleadingly, "Will you not tell me where
you are going, and what you will do?"
"Going to call Geordie and the lads, and then search the
road to the Old Man."
Poor Alice! She knew only too well how great was her stake,
too. But every wandering thought was called home to assist
in the dreaded duty of breaking Miles' mysterious
disappearance to the widowed mother.
Alice silently crossed the door, and left her to the prayer of
faith.
Now they have reached the Gap, and they look with inward
misgivings at the snowy battlements by which it was
defended—rampart, curtain, and fosse. However, borne by
their strong limbs and helped by their strong staves, and
impelled by their strong motive, the bold young men and
the brave old man forced their way through.
"No," said Mark, "I must search the mountain's side before I
go home."
But those tracks, all the while, were but the tracks of Tim o'
the Brooms.
Poor Chance! Thou dost not know how near is help, and
how it is already turning away and leaving thee in thy
distress. And yet thy poor unenlightened instinct is doing
wonders of self-sacrificing devotion, and of beautiful, tender
skill. Thou halt dug away the snow which had closed over
thy unconscious master; thou hast licked his pale forehead;
licked his livid face over and over again; licked his stiffening
wrists: takes his hand in thy mouth in thy agonized efforts
to rouse him from his strange, cold sleep; and then, lying
down close to his side, thou hast moaned and whined to the
winds. If there be a heart yet beating feebly within that
rigid form, it is because thy anxious efforts have not
suffered the last faint glow of animal heat to die out.
"What can that little line of thread be, up there in the hollow
of the crag?" asked Mark Wilson. "It cannot be a shred of
mist, can it? It looks strangely like smoke." They all looked
up; and there was, sure enough, a slender line of blue
smoke curling upward from a dark crevice of the rock.
"Up this way, lads; we will soon see what sort of bird has
been building its nest in such a queer hole as that."
"It is the nest of foul birds of prey, and we must net them, if
we can," remarked the schoolmaster, gloomily.
"Ay, ay, net them, master; and carry off the nest egg," said
the shepherd with a knowing smile.
"Come on," cried the schoolmaster, "we are doing our duty,
and that is enough for brave Englishmen."
The young men rushed down after the yet rolling figures,
and contrived to stop them in their headlong course. It was
but just in time; a yard or two more and they would have
bounded together down a precipice which was masked by
snow, and been dashed in pieces at the foot. Tim o' the
Brooms instantly shook himself free from the lads, writhing
from their grasp like a slippery serpent, as he was, glided
rapidly down the path, and disappeared.
"Now for the hawk's nest, without the old birds," said
Geordie.
"Ay, ay, the young master first of all, and then the spoil,"
replied Geordie Garthwaite.
"We had best have a dram to drive the cold out of us, in
course," suggested one of the farm lads.
"What if the Miner and Broom Tim should come back and
take all the stock away?" reasoned one of the young men,
as they descended.
"Well, well, you needn't say it; for I have had my heavy
doubts about what was a'foot for a good bit o'time. But
'twasn't for an old friend of the lad's, his father's servant
and his grandfather's before him, to say aught against the
good name of the family. But I have been sore sorry for the
mistress when the poor lad has been out o'nights, and
slighting the land by day. I've done my best to keep things
together, and taken more upon me than I should, like
enough. But it is an evil case when the master takes to bad
ways."
CHAPTER V.
HOME AGAIN.
Hours had passed at the Yews, and there was no sign of the
seekers or of the sought. Alice and Mat had been making
expeditions in all directions excepting that one which had
been taken by Mark and the farm servants; but not a trace
could they find. Old Ann had half buried herself in the snow
in her attempts to reach the furthest of the Beck meadows,
and had tottered home half dead with cold. Even Mr. Knibb
had saddled Madam, and attended by young Mat, had made
a bold dash at the road which led out of the dale at the end
opposite to the Green Gap. But Madam's shoes had become
so completely balled with snow, that it was with much ado,
he had led her back to the farm; while Mat had bravely
made his way to the little hamlet in the adjoining dale,
along roads less blocked by snow than the taken by the
schoolmaster and his party, but still formidable to any but a
shepherd lad.
The fine fellow pricked his ears, whined, and fawned upon
her, in full comprehension of the duty laid upon him, and
darted away before her.
She thought it strange that Geordie and his party had failed
to take the dog with them, as by far the most probable
means of finding the lost one; until she recollected that
there had been a great calling and whistling for the dogs at
the time of their setting forth, that Laddie could no where
be found because he was away on the lower fells with Mat,
in full business looking after the sheep, and that Chance
had been unaccountably missing all the day.
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.
ebooknice.com