100% found this document useful (8 votes)
31 views

(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

The document provides information about the ebook 'Learning jQuery 3', which focuses on building interactive websites using jQuery by automating tasks and simplifying complex processes. It includes details about the authors, publication information, and various editions of related jQuery books. Additionally, it features links for downloading the ebook and other jQuery resources available on ebooknice.com.

Uploaded by

ginggfizahgn
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (8 votes)
31 views

(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

The document provides information about the ebook 'Learning jQuery 3', which focuses on building interactive websites using jQuery by automating tasks and simplifying complex processes. It includes details about the authors, publication information, and various editions of related jQuery books. Additionally, it features links for downloading the ebook and other jQuery resources available on ebooknice.com.

Uploaded by

ginggfizahgn
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

Download Full Version ebook - Visit ebooknice.

com

(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;
https://ebooknice.com/product/learning-jquery-3-build-
Swedberg, Karl] ISBN 9781785882982, 1785882988
interesting-interactive-sites-using-jquery-by-automating-
common-tasks-and-simplifying-the-complicated-
ones-2017-5e-by-6857724

Click the button below to download

DOWLOAD EBOOK

Discover More Ebook - Explore Now at ebooknice.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Start reading on any device today!

(Ebook) Learning jQuery 3: Build interesting, interactive


sites using jQuery by automating common tasks and
simplifying the complicated ones by Adam Boduch; Jonathan
Chaffer; Karl Swedberg ISBN 9781785882982, 1785882988
https://ebooknice.com/product/learning-jquery-3-build-interesting-
interactive-sites-using-jquery-by-automating-common-tasks-and-
simplifying-the-complicated-ones-34631524
ebooknice.com

(Ebook) Learning jQuery 1.3 by Jonathan Chaffer; Karl


Swedberg ISBN 9781847196705, 1847196705

https://ebooknice.com/product/learning-jquery-1-3-1266146

ebooknice.com

(Ebook) Learning jQuery, Third Edition by Jonathan


Chaffer, Karl Swedberg ISBN 1849516545

https://ebooknice.com/product/learning-jquery-third-edition-2395766

ebooknice.com

(Ebook) Learning jQuery by Jonathan Chaffer, Karl Swedberg


ISBN 9781782163145, 9781782163152, 178216314X, 1782163158

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

(Ebook) jQuery Reference Guide: A Comprehensive


Exploration of the Popular JavaScript Library by Jonathan
Chaffer, Karl Swedberg ISBN 9781847193810, 1847193811
https://ebooknice.com/product/jquery-reference-guide-a-comprehensive-
exploration-of-the-popular-javascript-library-55923480

ebooknice.com

(Ebook) Learning jQuery, 4th Edition: Better interaction,


design, and web development with simple JavaScript
techniques by Jonathan Chaffer, Karl Swedberg ISBN
9781782163145, 178216314X
https://ebooknice.com/product/learning-jquery-4th-edition-better-
interaction-design-and-web-development-with-simple-javascript-
techniques-5474156
ebooknice.com

(Ebook) jQuery 1.4 Reference Guide by Karl Swedberg,


Jonathan Chaffer ISBN 9781849510042, 9781847196705,
9781847196989, 9781847196163, 9781847199720, 1849510040,
1847196705, 1847196985, 1847196160
https://ebooknice.com/product/jquery-1-4-reference-guide-43709634

ebooknice.com

(Ebook) Piano adventures Performance 3b by Nancy and


Randall Faber

https://ebooknice.com/product/piano-adventures-performance-3b-52393612

ebooknice.com
Title Page
Learning jQuery 3

Fifth Edition

Build interesting, interactive sites using jQuery by automating


common tasks and simplifying the complicated ones
Adam Boduch
Jonathan Chaffer
Karl Swedberg

BIRMINGHAM - MUMBAI

This book was downloaded from AvaxHome!

Visit my blog with more new books:

https://avxhm.se/blogs/AlenMiler
Copyright
Learning jQuery 3

Fifth Edition
Copyright © 2017 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored


in a retrieval system, or transmitted in any form or by any means,
without the prior written permission of the publisher, except in the
case of brief quotations embedded in critical articles or reviews.

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.

Packt Publishing has endeavored to provide trademark information


about all of the companies and products mentioned in this book by
the appropriate use of capitals. However, Packt Publishing cannot
guarantee the accuracy of this information.

First published : July 2007

Second edition: Feburary 2009

Third edition: September 2011

Fourth edition: June 2013

Fifth edition: May 2017


Production reference: 1240517

Published by Packt Publishing Ltd.


Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.

ISBN 978-1-78588-298-2

www.packtpub.com

This book was downloaded from AvaxHome!

Visit my blog with more new books:

https://avxhm.se/blogs/AlenMiler
Credits

Authors

Adam Boduch Copy Editor

Jonathan Chaffer Charlotte Carneiro

Karl Swedberg

Reviewer Project Coordinator

Andrew Kurz Devanshi Doshi

Commissioning Editor Proofreader

Amarabha Banerjee Safis Editing


Acquisition Editor Indexer

Smeet Thakkar Tejal Daruwale Soni

Content Development Editor Graphics

Onkar Wani Jason Monteiro

Technical Editor Production Coordinator

Rashil Shah Nilesh Mohite


About the Authors
Adam Boduch has been involved with large-scale JavaScript
development for nearly 10 years. Before moving to the frontend, he
worked on several large-scale cloud computing products, using
Python and Linux. No stranger to complexity, Adam has practical
experience with real-world software systems, and the scaling
challenges they pose.

He is the author of several JavaScript books, including React and


React Native, and is passionate about innovative user experiences
and high performance.

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.

Jonathan Chaffer is a member of Rapid Development Group, a


web development firm located in Grand Rapids, Michigan. His work
there includes overseeing and implementing projects in a wide
variety of technologies, with an emphasis on PHP, MySQL, and
JavaScript. In the open source community, he has been very active
in the Drupal CMS project, which has adopted jQuery as its
JavaScript framework of choice. He is the creator of the Content
Construction Kit, now a part of the Drupal core used for managing
structured content. He is also responsible for major overhauls of
Drupal's menu system and developer API reference. In his spare
time, he designs board and card games for the hobby market. He
lives in Grand Rapids with his wife, Jennifer.

Karl Swedberg is a web developer at Fusionary Media in Grand


Rapids, Michigan, where he spends much of his time writing both
client-side and server-side JavaScript. When he isn't coding, he likes
to hang out with his family, roast coffee in his garage, and exercise
at the local gym.
About the Reviewer
Andrew Kurz is a UI/UX designer and developer with over 12 years
of experience designing and building websites and online
applications. He has worked for small start-ups, large corporations,
and everything in between. He enjoys learning new technology and
appreciates attractive, easy-to-use applications. He lives in Atlanta,
GA, with his wife and three children. You can view his portfolio and
contact him at www.kurzstudio.com.
www.PacktPub.com
For support files and downloads related to your book, please visit ww
w.PacktPub.com.

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.

At www.PacktPub.com, you can also read a collection of free technical


articles, sign up for a range of free newsletters and receive exclusive
discounts and offers on Packt books and eBooks.

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 2,Selecting Elements, teaches you how to use jQuery's


selector expressions and DOM-traversal methods to find elements on
the page, wherever they may be. You'll use jQuery to apply styling
to a diverse set of page elements, sometimes in a way that pure CSS
cannot.

Chapter 3, Handling Events, walks you through jQuery's event-


handling mechanism to fire off behaviors when browser events
occur. You'll see how jQuery makes it easy to attach events to
elements unobtrusively, even before the page finishes loading. Also,
you'll get an overview of deeper topics, such as event bubbling,
delegation, and namespacing.

Styling and Animating, introduces you to jQuery's


Chapter 4,
animation techniques and how to hide, show, and move page
elements with effects that are both useful and pleasing to the eye.

Chapter 5,Manipulating the DOM, teaches you how to change your


page on command. This chapter will also teach you how to alter the
very structure of an HTML document as well as adding to its content
on the fly.

Sending Data with Ajax, walks you through many ways in


Chapter 6,
which jQuery makes it easy to access server-side functionality
without resorting to clunky page refreshes. With the basic
components of the library well in hand, you will be ready to explore
how the library can expand to fit your needs.
Chapter 7, Using Plugins, shows you how to find, install, and use
plugins, including the powerful jQuery UI and jQuery Mobile plugin
libraries.

Chapter 8,Developing Plugins, teaches you how to take advantage of


jQuery's impressive extension capabilities to develop your own
plugins from the ground up. You'll create your own utility functions,
add jQuery object methods, and discover the jQuery UI widget
factory. Next, you'll take a second tour through jQuery's building
blocks, learning more advanced techniques.

Chapter 9,Advanced Selectors and Traversing, refines your knowledge


of selectors and traversals, gaining the ability to optimize selectors
for performance, manipulating the DOM element stack, and writing
plugins that expand selecting and traversing capabilities.

Advanced Events, dives further into techniques such as


Chapter 10,
delegation and throttling that can greatly improve event-handling
performance. You'll also create custom and special events that add
even more capabilities to the jQuery library.

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.

Chapter 12,Advanced DOM Manipulation, provides you with more


practice modifying the DOM with techniques such as attaching
arbitrary data to elements. You'll also learn how to extend the way
jQuery processes CSS properties on elements.

Chapter 13,Advanced Ajax, helps you achieve a greater


understanding of Ajax transactions, including the jQuery deferred
object system for handling data that may become available at a later
time.
Appendix A, Testing JavaScript with QUnit, teaches you about the
QUnit library, which is used for the unit testing JavaScript programs.
This library will be a great addition to your toolkit for developing and
maintaining highly sophisticated web applications.

Appendix B, Quick Reference, provides a glimpse of the entire jQuery


library, including every one of its methods and selector expressions.
Its easy-to-scan format is perfect for those moments when you know
what you want to do, but you're just unsure about the right method
name or selector.
What you need for this book
In order to run the example code demonstrated in this book, you
need a modern web browser, such as Google Chrome, Mozilla
Firefox, Apple Safari, or Microsoft Edge.

To experiment with the examples and to work on the chapter-ending


exercises, you will also need the following:

A basic text editor


Web development tools for the browser, such as Chrome
Developer Tools or Firebug (as described in the Using
development tools section of Chapter 1, Getting Started)
The full code package for each chapter, which includes a copy of
the jQuery library (seen in the Downloading the example code
section)

Additionally, to run some of the Ajax examples in Chapter 6, Sending


Data with Ajax and beyond, you will need Node.js.
Who this book is for
This book is ideal for client-side JavaScript developers. You do not
need to have any previous experience with jQuery, although basic
JavaScript programming knowledge is necessary.
Exploring the Variety of Random
Documents with Different Content
and overcome him, and take from him all his armour
wherein he trusteth, and divide his spoils."

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.

"Be off; Chance, I say—away with thee, Laddie," said their


poor master from the chamber window. Laddie obeyed, and
disappeared; Chance withdrew a few yards, and then sat
down determinately on the cold white snow. They thought
he was gone, and the voices renewed their parley.

"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.

"What are you at by saying for us? It is just as much for


yourself. You are in it full as deep as we. I would lame his
old mare, but the stable door is locked, and the dogs are
about."

"He came unbidden, and he shall leave unhindered," said


Miles firmly.

"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.

* Across Morecambe Bay.


CHAPTER III.
THE SNOW-DRIFT.

"A snow-feathered pillow,


On snow-drifted bed;
As foam on the billow,
So white was it spread."

Miles leaned on the windowsill, and thought long and


anxiously. The snow, continued to fall, soft and silent. The
deep stillness of the night was oppressive in its solemn
weight. Even the dreary night-wind seemed to hold its
breath for awe; but all this while, each downy snowflake
that fluttered to the ground took its place slowly and surely
beside its sister-flake, quietly laying the foundations of one
of those heavy and long-standing falls which sometimes re-
assert their dominion over the mountain land, even after
spring has begun to awaken the sleeping life of the earth.

The soul of Miles Lawson was in the darkness of desertion


and dismay. He thought that every moment there was a
fresh loop added to the great net which Satan was forming
around him; he almost fancied he could see him netting,
netting on, plying his mesh and his supple cords, the while
he laughed at his misery. "He got my will first; and now he
has bound my limbs, so that I cannot work when I would.
This is thick darkness—no light and no hope. And all this
while I am losing precious time; all this while those men,
who are too strong and too cunning for me, are laying their
dreadful traps and snares at Bella's very door. I can't
endure that. Anything rather than that. I will go directly to
Scarf Beck, and give them warning; informer or no
informer, spy or no spy, traitor or not, I will go and save
Bella and those harmless lads from wrong."

He tried to open the window again, but it would scarcely


stir, for it was so banked up with snow. "Darkness, deathly
darkness, and deep, treacherous snow!" muttered the
miserable young man. Suddenly there was a rent in the
black pall of clouds, which parted on either hand, and the
full moon looked serenely down upon the white world
beneath.

Miles clasped his hands: "Oh, Father of the repentant


prodigal! If thou canst part the thick clouds like that, and
give light, wilt thou not give me light in my soul, and show
me the way I should go?" He repeated over to himself "the
way—the way," when suddenly there darted into his
bewildered mind the luminous words, "I am the way, the
truth; and the life. No man cometh unto the Father, but by
me."

Miles crept to his bedside, and dropped down on his knees


in the very place where he used to pray his little prayers
when he was yet a little child; and, like a little child, he
clasped his hands, and prayed the simple prayers of his
childhood. He even remembered every word of the hymn
with which his mother used to sing him to sleep, and he
repeated that too. Miles continued long on his knees, and
when he gently rose and went to the window, it was not
with the "exceeding bitter cry" with which he had last
sprung to his feet, but with the words, whispered as if he
could "scarce believe for joy and wonder":
"Hast thou indeed found me, O my Saviour?"

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.

"Nevertheless I must go," said he, firmly, in answer to the


remonstrances of thought; "Bella must be saved at any cost
from this wicked wrong; and I must tell these men that I
have done with them forever, but that I will not inform
against them if they will only give up the bad line they are
in, and leave the neighborhood."

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.

He passed through the farm-yard, and his favorite young


horse whinnied when he heard his master's step, muffled
thought it was by the deadening snows. Laddie sprang to
his side, but was waved off; Chance did not appear, yet all
the while he was watching and lurking about behind
corners, and under walls; for he had settled it in his faithful
mind that go he would, whatever orders he received to the
contrary. He did not like the look of the man who had been
whistling and whispering under the window, and he did not
like the snow; and therefore if danger were abroad,
wherever his master was, there would his faithful servant
be.

Miles was quite unconscious of this mute resolve, and of its


answering movements, but plodded heavily on along the
white lane, and across the white fields in the well-known
direction of Green Gap. As he approached the narrow
gateway into the glen, he found that the snow forced
through the narrow pass by the driving wind of the previous
evening, had been whirled about in wild eddies, and had
then settled into fantastic wreaths, or gathered into smooth
and sloping banks, as the accidents of the ground or the
impulse of the gale had determined. Onward, however, he
forced his way, until he was startled to see that, in the very
jaws of the Gap white walls rose above his head, here eight,
then ten, now twelve feet high, sometimes smooth as
Parian marble; at others, crested like a breaking wave.
What if that curling and foaming billow should suddenly
bend, break, and engulf him? What if the treacherous wind
should blow a blast against that mountain surge, and shiver
it into showers of frozen spray? He stops and looks up. The
moon is shining coldly upon the glistening crags; and there,
gleaming through the Gap, rises the Old Man, with a white
sheet thrown over his lofty forehead, enwrapping his broad
shoulders, and lying in glittering folds about his feet.

The scene was magnificent in its wintry grandeur; but it was


appalling to the young man's mind. How was he to force his
lonely way up the gorge to Scarf Beck? He clasped his cold
hands and breathed a prayer for guidance; "Leave me not,
neither forsake me; show me the way in which thou
would'st have me to walk, outwardly as well as inwardly,
through the snows and through the snares. Guide me by
thine eye: uphold me with thy hand. I look unto thee to
save me, for thou art my God." These, and other little
fragments of broken prayer, little snatches of precious
psalms, little bits of remembered teachings, came thrilling
through his bewildered mind.

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.

Is he in the right path? He looks round, but he is growing


dizzy: his eyes must be dazzled by the moonshine on the
glittering snows: it is sickening, that changeless glare. He
wishes the moon would go behind the cloud to relieve his
giddy brain for one brief space, only that would leave him in
darkness.

On, then he must go. He should be beside the beck by this


time, Scarf Beck, Bella's beloved stream. Ah, that thought
rouses him from his sleepy languor. He listens: he catches a
muffled sound—how unlike its usual living gladness; how
thick its voice compared with its wonted clear cadences, or
with its loud tumultuous brawl when once it is angry. It
must be half choked with snows and dulled with intruding
ice. Ah, the weariness and the weight! He must rest, must
sleep away his sickening giddiness, just for a little moment,
before he struggles and labors onward. He is reeling,
rambling towards that smooth bed, that soft pillow, those
fringed curtains, those white and winding sheets. Stay,
Miles, it is the cold white bed of death.
Now Chance, this is thy moment. Thou hast been laboring
on after thy unconscious master without a word to
encourage thee, without a sign to teach thee thy duty: thou
hast dragged thy weary way a few yards behind him, not
daring to show thy self for fear of being driven back as
usual, Now, then, at last, thy time come. The noble dog
plunges forward, all tired as he is, and jumps to lick his
failing master's hand.

"What is it? Chance, my poor, poor fellow, art thou come to


help thy master? Thanks, thanks, Chance," murmured he in
a dull, dreary voice. But the kind tone, the evident
acceptance of his poor presence, the hand laid upon his
great black head, all this was payment enough, and over
payment to old Chance, and he is happy.

Encouraged by his dog's companionship, Miles struggles on


a few yards further. But his spasmodic efforts cannot hold
out much longer. Once more, he reels, staggers, sinks into a
deep drift. And there we leave him to sleep out his leaden
sleep, which that melancholy bark of the old dog, and that
most piteous whining have no power to awaken.

CHAPTER IV.
THE SEARCH.

"Take we heed to all our foot-


prints;
Tell-tales are they, where we
go.
Let them bear no evil witness
On the sand, or on the snow;
On the mould, or on the clay,
Or life's dusty, thronged
highway."

THE family at The Yews are sleeping rather longer than


usual on the morning at which we are now arrived. Sleep
had been a late guest at the pillows of several of the
household, for anxious thoughts had kept the earlier
watches of the night with them, "holding their eyes
waking." At last Mat was up, and out with Geordie and the
farm lads, looking after the sheep. Laddie was at hand in
readiness to help; but Chance failed to obey the whistle
which generally brought him in a moment, eager for his
work.

"What's to do with the old dog, that he doesn't come at


call?" said Geordie Garthwaite; "I heard both the dogs
barking terribly fierce in the night; but Chance is no where
this morning. Is the young master at home, I wonder?"

"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.

"Miles dear," shouted Alice at her brother's door—"Miles,


come to breakfast."

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."

"Gone?" exclaimed Mark, with terror in his face, "and such a


night!"

He ran up stairs to Miles's room to try to collect evidences


of what had occurred; but he could gain nothing here. Then
the place where hung the hats and plaids was examined;
and Miles's hat and plaid were gone; his boots were gone
too, and his mountain staff.

"He has taken his 'comforter,'" sobbed Alice, "mine that he


liked so much; and the gloves that I knitted."

"Has he?" said Mark, with a brightening face, "then he


wasn't desperate; he wouldn't have done things so orderly,
unless he were cool and clear. There is hope in that, dear
Alice;" and he took her hand tenderly. "I will go and seek
him; and thou must trust me, as thou would'st a brother."

"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."

Alice shuddered; and quietly laying her cold hand on his


arm, said, "Mark, you must let me go with you. I cannot
stay behind."

"And leave the mother in her desolation, Alice? Besides," he


added in a low voice, as he rushed out through the porch,
"how could I bear to risk my all?"

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.

There was no wringing of hands, no tearing of hair, no wild


burst of passionate grief; but there was a look of
inexpressible anguish which seemed to make her ten years
older at one stroke; and there were just these few words, "I
had best be alone, Alice, dear; but bring me my book; for I
am thinking I shall want every promise I can find, and
every prayer I can pray."

Alice silently crossed the door, and left her to the prayer of
faith.

In the meantime, Mark was far on his way to the Green


Gap, striding onward in eager haste, and Geordie and the
lads plodded after, looking anxiously for tracks as they
went. But some fresh snow had fallen in the early morning,
obliterating the footmarks which had been left, first by Tim
o' the Brooms, and then by Miles and his mute companion.

"I see nothing but smooth snows," shouted Mark to the


group behind him.

"Well, Master Wilson, I seem to see sores in the snow,


which have healed over, like. They'll serve for the length of
a man's stride well enough, too. Look ye here."
And here and there slight signs of disturbance were just
visible, though only the eye of a shepherd, who had often
tracked his lost sheep in the fields and fells of snow, could
have detected them.

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.

On the further side of the barrier there were two mountain


roads branching off from that which they had been
following, the one leading up the gorge to Scarf Beck Farm,
the other winding up the side of the Old Man. The party
stop to consider. Mark Wilson thinks he has grounds for the
belief that his friend would take the way of the mountain;
but as his suspicions are vague, founded only upon the
hints and half-revealings of the previous day, which he had
painfully put together, he could give his companions no
reason for the course which he intended to pursue.

"Seems to me," said Geordie Garthwaite, "that young


master is kind, like, to Scarf Beck Bella—and so, like
enough, he's gone there. That's an old man's mind upon it."

"No," said Mark, "I must search the mountain's side before I
go home."

"Then it's my belief," replied Geordie, "that we shall never


get home at all, if we do the like of that. There's snow
enough in places to bury us all, like sheep. But, stay!
What's this, again?"

And sure enough there were undeniable footmarks plodding


up the path which led to the old workings of a deserted
mine, high up on the mountainside.

Geordie stooped down and examined. "It's a man's foot,


however, turning up here; and the prints are part filled
again with new snow, looser and softer than the old. So it's
done since evening, when there was the great fall. We'll try
the mountain, master."

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.

The little band of searchers is now working its way wearily


up the steep. It was well that the old shepherd knew the
path in past times, or they would have been inevitably lost.
They are too much engrossed, by their life and death
engagement, to see how glorious in its wintry majesty is
the scene above, beneath, and around; the shining crest of
the mountain, each broad white shoulder, and every
descending line, sharply cut against the dark blue sky; the
lake beneath as blue as the deep sapphire above, each
headland projected in silvery curves into the lake, pencilled
with the feathery outlines of snow-laden branches, or
heavily fringed and embroidered with the dull dark green of
the pines. The crags, where they were too precipitous to
afford a resting-place to the snows, on ledge or in hollow,
looked out stern and bald from the prevailing drapery; and
here and there a fleecy cloud had floated down to hold
some mysterious parley with a mountain-top, for the time
confounding all distinction between earth and sky.

"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.

"Smoke, heather smoke, and none other, unless I am


blinded with the snow," was Geordie's reply. "It's
uncommon strange, that. Come, my lads, we will find out
who has lighted a heather fire up on the heights like that,
and what for it is."

Mark made no reply, but strode and clambered on. He had


his own painful theory whereby to account for the
phenomenon. They were now at the foot of the crag, when
first one man's head, and then another, was seen peering
down over the rocks. The heads instantly disappeared
again; and presently, after, the curling line of blue smoke
disappeared also; but the old shepherd's practised eye had
already carefully taken its bearings and noted its way-
marks.

"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.

"Have they got guns up there, I wonder?" said one of the


farm lads, in a hesitating voice. "I can't say as though I
much like the sport."

"Come on," cried the schoolmaster, "we are doing our duty,
and that is enough for brave Englishmen."

Scarcely had he spoken when a bullet whistled sharply past


his head, and splintered a projecting point of rock close
behind him.

"Now, then, I am strong to do my duty," said Mark, "for


they are murderers in their hearts, though God has spared
me."

Another bullet whizzed by.

"This will not do at all," said old Geordie, quietly; "now,


then, my lads, make a rush for your dear lives."

The old man planted his iron-shod shepherd's staff on the


rock, and sprang up with the agility of a native-born
cragsman; for he had robbed many a raven's nest, and
eagle's eyrie, in his distant youth, and had won the
shepherd's prize for the feat. At this instant, a man rushed
down the craggy path and sprang away like a goat from
rock to rock.

"There goes Miner Jack," cried one of the lads.

But another figure which had been stealing round a buttress


of the mountain fortress, suddenly leaped out upon Mark
Wilson with a yell of hatred, and grappling with him, rolled
heavily down the steep.
"Save the master, save him," shouted old Geordie from
above.

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.

They climbed to the entrance of an old working of the


deserted mine—an "adit," the Cornish miners would have
called it—and looking in, they were half-stifled by the
smoke of an expiring heather fire, and by the stupefying
fumes of distilling whiskey.

Mark's eye eagerly searched the cave for an expected


object, but that object, to his inexpressible relief, he found
not.

"Thank heaven he isn't here," whispered he. "Thank God for


our preservation," he solemnly added, aloud: and the three
men stood in deep silence, the two young men and the old,
while the schoolmaster offered up a brief thanksgiving in
that strange oratory.

Then came the difficult consideration of what must be done


under such novel circumstances. Here was a perfect little
distillery in full working; the whole plant, as it is termed, of
an illicit still, in complete order. Here was a large heap of
dried heather stored up for fuel; for it is the heather smoke
which imparts that peculiar mountain flavor which
distinguished the illicit whiskey from the lawfully
manufactured but ever dangerous and treacherous liquor.
And there, in the deep chamber of the adit, was a long
array of stone jars, many of them evidently full and others
empty; while just at the mouth of the cave was a lot of
heavy jars, arranged as if in readiness for removal.

"I take possession in the king's name," said Mark, with


serious dignity. "This discovery must be notified
immediately to Mr. Knibb; and then we wash our hands of
the affair. But recollect, my friends, we have not yet found
Miles Lawson. Everything must be sacrificed to the search
for him. All this, while he may be perishing in the snow."

"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.

"And just to see if it is worth anything," added the other.

"Not a drop shall be touched," said Mark, firmly; "I wish I


dare pour it all out on the heather; but it is not ours end I
cannot do as I would. Now for the young master, without a
moment's waste of time."

"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.

"They will not do that," said old Geordie. "They saw we


knew them, and they are far enough off by this time.
Besides, they'd never think we should be such silly folks as
to leave the prey." Then, coming close to Mark, he said in a
low voice, "What is't has brought you a'top here, Master
Wilson, to seek for young master in such a rabbit-hole like?"
"I had rather not tell even such an old friend of the Lawsons
as you are, Geordie; only I am humbly thankful that we
have not found him there."

"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."

"What is your advice now Geordie?" asked the


schoolmaster. "For I am quite at sea again."

"I thought so. Well, it's my counsel that we go home round


by way of Scarf Beck, and see if they know aught about
him, there."

"That is it," said Mark, with a gleam of revived hope; "round


by way of Scarf Beck, lads, as fast as legs can carry us. My
watch to whoever finds him first."

CHAPTER V.
HOME AGAIN.

"Thou wilt not be weary of me;


Thy promise my faith will
sustain;
And soon, very soon I shall see
That I have not been asking in
vain."
A. L.
WARING.

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.

At last, the suspense had become intolerable to Alice, and


watching her opportunity when she saw old Ann settled in
by the warm fire beside her mother's rocking chair, she
called Laddie, and set forth.

"Now Laddie," said she in a cheery voice, waving her hand


around her, "we must find master."

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.

"No, stop; keep beside me, Laddie, I say."

He leaped back to her side, in recognition of the second


clause of his important commission.

"Master," said she, pointing at the snow.

He sniffed carefully about, and then set his face


determinately towards Green Gap.

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.

The young dog was now evidently following up a good


scent, as his short, pleased barks and determined manner
proceeding sufficiently testified. She plunged and plodded
after him through the snow as fast as her limbs could carry
her, but his chiding impatience at the slowness of the
progress was painful to her to behold. They have passed
Green Gap now, though nothing less than her own strong
love and her stimulating fears could have carried the young
girl through the perils of the pass.

"Which way, now?"

The way up the gorge to Scarf Beck without a doubt; Laddie


has evidently no misgiving whatever; for he has tried the
trampled road to the mountain, renounced it immediately,
trying back for a few yards until, with a short cry, he
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebooknice.com

You might also like