JavaScript Step by Step Step by Step Second Edition Steve Suehring PDF Download
JavaScript Step by Step Step by Step Second Edition Steve Suehring PDF Download
https://ebookultra.com/download/javascript-step-by-step-step-by-
step-second-edition-steve-suehring/
https://ebookultra.com/download/linear-algebra-step-by-step-singh/
https://ebookultra.com/download/rhs-gardening-step-by-step-dk/
https://ebookultra.com/download/basics-of-dental-technology-a-step-by-
step-approach-second-edition-johnson/
https://ebookultra.com/download/project-management-step-by-step-1st-
edition-larry-richman/
Abdominal Ultrasound Step by Step 2nd Edition Berthold
Block
https://ebookultra.com/download/abdominal-ultrasound-step-by-step-2nd-
edition-berthold-block/
https://ebookultra.com/download/permaculture-design-a-step-by-step-
guide-aranya-author/
https://ebookultra.com/download/step-by-step-laser-in-
ophthalmology-1st-edition-edition-bhattacharya/
https://ebookultra.com/download/step-by-step-a-pedestrian-memoir-
first-edition-lawrence-block/
https://ebookultra.com/download/microsoft-outlook-2010-step-by-
step-1st-edition-joan-lambert/
JavaScript Step by Step Step By Step Second Edition
Steve Suehring Digital Instant Download
Author(s): Steve Suehring
ISBN(s): 9780735645523, 0735645523
Edition: Second Edition
File Details: PDF, 6.07 MB
Year: 2010
Language: english
JavaScript Step by Step,
Second Edition
Download from Wow! eBook <www.wowebook.com>
Steve Suehring
Published with the authorization of Microsoft Corporation by:
O’Reilly Media, Inc.
1005 Gravenstein Highway North
Sebastopol, California 95472
Complying with all applicable copyright laws is the responsibility of the user. All rights reserved. Without limiting the
rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or
transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any
purpose, without express written permission of O’Reilly Media, Inc.
123456789 M 543210
Microsoft Press titles may be purchased for educational, business or sales promotional use. Online editions are also
available for most titles (http://my.safaribooksonline.com). For more information, contact our corporate/institutional
sales department: (800) 998-9938 or corporate@oreilly.com. Visit our website at microsoftpress.oreilly.com. Send
comments to mspinput@microsoft.com.
Microsoft, Microsoft Press, ActiveX, Excel, FrontPage, Internet Explorer, PowerPoint, SharePoint, Webdings, Windows,
and Windows 7 are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or
other countries. Other product and company names mentioned herein may be the trademarks of their respective owners.
Unless otherwise noted, the example companies, organizations, products, domain names, e-mail addresses, logos,
people, places, and events depicted herein are fictitious, and no association with any real company, organization, prod-
uct, domain name, e-mail address, logo, person, place, or event is intended or should be inferred.
This book expresses the author’s views and opinions. The information contained in this book is provided without any
express, statutory, or implied warranties. Neither the author, O’Reilly Media, Inc., Microsoft Corporation, nor their
respective resellers or distributors, will be held liable for any damages caused or alleged to be caused either directly
or indirectly by such information.
978-0-735-64552-3
To Chris
—Steve Suehring
Download from Wow! eBook <www.wowebook.com>
Contents at a Glance
Part I JavaWhat? The Where, Why, and How of JavaScript
1 JavaScript Is More Than You Might Think . . . . . . . . . . . . . . . . . . . . 3
2 Developing in JavaScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3 JavaScript Syntax and Statements . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4 Working with Variables and Data Types . . . . . . . . . . . . . . . . . . . . . 61
5 Using Operators and Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . 99
v
vi Contents at a Glance
Part V jQuery
21 An Introduction to JavaScript Libraries and Frameworks . . . . . 383
22 An Introduction to jQuery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
23 jQuery Effects and Plug-Ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
Table of Contents
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Introducing JavaScript Step by Step, Second Edition . . . . . . . . . . . . . . . . . . . . . xix
Getting Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxii
Microsoft is interested in hearing your feedback so we can continually improve our books and learning
resources for you. To participate in a brief online survey, please visit:
www.microsoft.com/learning/booksurvey/
vii
viii Table of Contents
2 Developing in JavaScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
JavaScript Development Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Configuring Your Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Writing JavaScript with Visual Studio 2010 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Your First Web (and JavaScript) Project with Visual Studio 2010 . . . . . . 24
Using External JavaScript Files with Visual Studio 2010 . . . . . . . . . . . . . . 28
Writing JavaScript with Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Your First Web (and JavaScript) Project with Eclipse . . . . . . . . . . . . . . . . . 33
Using External JavaScript Files with Eclipse . . . . . . . . . . . . . . . . . . . . . . . . 38
Writing JavaScript Without an IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Your First Web (and JavaScript) Project with Notepad . . . . . . . . . . . . . . . . 41
Using External JavaScript Files Without an IDE . . . . . . . . . . . . . . . . . . . . . 44
Debugging JavaScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Part V jQuery
21 An Introduction to JavaScript Libraries and Frameworks . . . . . 383
Understanding Programming Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
Defining Your Own JavaScript Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
Looking at Popular JavaScript Libraries and Frameworks . . . . . . . . . . . . . . . . 385
jQuery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
Yahoo! User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
MooTools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
Other Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
Appendix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
Microsoft is interested in hearing your feedback so we can continually improve our books and learning
resources for you. To participate in a brief online survey, please visit:
www.microsoft.com/learning/booksurvey/
Acknowledgements
Every time I write a book, I get mired in a futile attempt to thank everyone who has helped
make it possible. I originally thought that I should thank everyone and their respective fami-
lies in case I never wrote a book again. But now that I’ve written several books, some of them
twice, there seems to be less urgency to thank everyone. It’s not that people need to be
thanked less or that I did this all myself—far from it. But inevitably I always forget to thank
someone, and though they may not be offended (who cares, it’s just a technology book), I
still feel bad.
And yet as I sit here and write these acknowledgements, I still want to thank some people.
As always, this is in no particular order and the list is incomplete. Obviously, thank you to
Rebecca and Jakob and my family, who support the 16 to 20 hour days involved in getting a
book written in a short time. Thanks to Russell Jones at O’Reilly for his editing and encour-
agement throughout, and thanks to Neil Salkind at Studio B as well. Thanks to Chris Tuescher,
John Hein, Jeremy Guthrie, and Jim Leu, Andy Berkvam, Dan Noah, Justin Hoerter, and Mark
Little. All those individuals told me that when I thank them in a book they feel compelled to
buy a copy. (If it worked like that for everyone, I’d go get the phone book.) While I’m fishing
for people to thank, I should thank Jason, Kelly, John, and Jeff as well as the web team and all
my coworkers.
Thanks to brother Bob for helping me choose music to write by. Thanks as well to Jim Oliva
and John Eckendorf. More than one Saturday morning was spent listening to the radio while
writing, and it made working on a Saturday morning less painful. Thank you to Tim and Rob
at Partners, Pat Dunn, and Dave Marie as well. Thank you to Jeff Currier for putting a door on
my office.
Thank you also to the readers who sent feedback for the first edition of the book. That
helped in shaping some of the areas to highlight in this second edition.
After rereading these acknowledgements, I realize I should have just thanked everyone using
first names. That would give plausible deniability: “Yes, when I thanked John, I really meant
you and not the other one.” I think there was someone else that I promised to thank, too, but
I can’t recall who, but thank you, too.
xvii
Introducing JavaScript Step by Step,
Second Edition
Much has changed since the first edition of JavaScript Step by Step was written in 2007. The
underlying JavaScript specification received a major update; Microsoft released Windows
Internet Explorer 8—and now 9 (which is about to be released as I write this); JavaScript
development frameworks have matured and are now ubiquitous; and browsers other than
Internet Explorer and Firefox, such as Safari, Chrome, and mobile browsers, became much
more popular.
This second edition of JavaScript Step by Step builds on the foundation laid down by the first
edition. The underlying architecture of the JavaScript language is largely the same, but its use
has become pervasive, increasing hugely even in just the last three years. With that in mind,
the layout and coverage of the book have also remained largely the same, with two notable
exceptions: this edition places a much greater emphasis on JavaScript event handling, and it
includes an entirely new section covering JavaScript libraries. Specifically, the book focuses
on jQuery, which can help simplify JavaScript development, especially on large projects.
Throughout the book, you’ll find highlights and additions for the new features in the latest
version of JavaScript. Also, the examples used in the book received greater scrutiny, in mul-
tiple browsers, to reflect the reality of today's web landscape. Reader feedback from the first
edition is reflected in the content and was the impetus for adding jQuery and emphasizing
event handling.
The introduction to the first edition is still relevant and applicable, and so I’ve included it
here.
This book provides an introductory look at JavaScript, including some of its core functions
as well as newer features and paradigms, such as Asynchronous JavaScript and XML (AJAX).
Today’s web users rely on many different platforms and many different browsers to view
web content. This fact was central to development of every aspect of the book, so you’ll see
screenshots in multiple browsers and an emphasis on standards-based, rather than propri-
etary, JavaScript development.
xix
Other documents randomly have
different content
There are four different modes of payment prevalent among the
several labourers employed at the metropolitan dust-yards:—(1) by
the day; (2) by the piece or load; (3) by the lump; (4) by
perquisites.
1st. The foreman of the yard, where the master does not perform
this duty himself, is generally one of the regular dustmen picked out
by the master, for this purpose. He is paid, the sum of 2s. 6d. per
day, or 15s. per week. In large yards there are sometimes two and
even three yard-foremen at the same rate of wages. Their duty is
merely to superintend the work. They do not labour themselves, and
their exemption in this respect is considered, and indeed looked on
by themselves, as a sort of premium for good services.
THE LONDON DUSTMAN.
Dust Hoi! Dust Hoi!
[From a Daguerreotype by Beard.]
2nd. The gangers or collectors are generally paid 8d. per load for
every load they bring into the yard. This is, of course, piece work,
for the more hours the men work the more loads will they be
enabled to bring, and the more pay will they receive. There are
some yards where the carters get only 6d. per load, as, for instance,
at Paddington. The Paddington men, however, are not considered
inferior workmen to the rest of their fellows, but merely to be worse
paid. In 1826, or 25 years ago, the carters had 1s. 6d. per load; but
at that time the contractors were able to get 1l. per chaldron for the
soil and “brieze” or cinders; then it began to fall in value, and
according to the decrease in the price of these commodities, so have
the wages of the dust-collectors been reduced. It will be at once
seen that the reduction in the wages of the dustmen bears no
proportion to the reduction in the price of soil and cinders, but it
must be borne in mind that whereas the contractors formerly paid
large sums for liberty to collect the dust, they now are paid large
sums to remove it. This in some measure helps to account for the
apparent disproportion, and tends, perhaps, to equalize the matter.
The gangers, therefore, have 4d. each, per load when best paid.
They consider from four to six loads a good day’s work, for where
the contract is large, extending over several parishes, they often
have to travel a long way for a load. It thus happens that while the
men employed by the Whitechapel contractor can, when doing their
utmost, manage to bring only four loads a day to the yard, which is
situated in a place called the “ruins” in Lower Shadwell, the men
employed by the Shadwell contractor can easily get eight or nine
loads in a day. Five loads are about an average day’s work, and this
gives them 1s. 8½d. per day each, or 10s. per week. In addition to
this, the men have their perquisites “in aid of wages.” The collectors
are in the habit of getting beer or money in lieu thereof, at nearly all
the houses from which they remove the dust, the public being thus
in a manner compelled to make up the rate of wages, which should
be paid by the employer, so that what is given to benefit the men
really goes to the master, who invariably reduces the wages to the
precise amount of the perquisites obtained. This is the main evil of
the “perquisite system of payment” (a system of which the mode of
paying waiters may be taken as the special type). As an instance of
the injurious effects of this mode of payment in connection with the
London dustmen, the collectors are forced, as it were, to extort from
the public that portion of their fair earnings of which their master
deprives them; hence, how can we wonder that they make it a rule
when they receive neither beer nor money from a house to make as
great a mess as possible the next time they come, scattering the
dust and cinders about in such a manner, that, sooner than have any
trouble with them, people mostly give them what they look for? One
of the most intelligent men with whom I have spoken, gave me the
following account of his perquisites for the last week, viz.: Monday,
5½d.; Tuesday, 6d.; Wednesday, 4½d.; Thursday, 7d.; Friday, 5½d.;
and Saturday, 5d. This he received in money, and was independent
of beer. He had on the same week drawn rather more than five loads
each day, to the yard, which made his gross earnings for the week,
wages and perquisites together, to be 14s. 0½d. which he considers
to be a fair average of his weekly earnings as connected with dust.
3rd. The loaders of the carts for shipment are the same persons as
those who collect the dust, but thus employed for the time being.
The pay for this work is by the “piece” also, 2d. per chaldron
between four persons being the usual rate, or ½d. per man. The
men so engaged have no perquisites. The barges into which they
shoot the soil or “brieze,” as the case may be, hold from 50 to 70
chaldrons, and they consider the loading of one of these barges a
good day’s work. The average cargo is about 60 chaldrons, which
gives them 2s. 6d. per day, or somewhat more than their average
earnings when collecting.
4th. The carriers of cinders to the cinder heap. I have mentioned
that, ranged round the sifters in the dust-yard, are a number of
baskets, into which are put the various things found among the dust,
some of these being the property of the master, and others the
perquisites of the hill man or woman, as the case may be. The
cinders and old bricks are the property of the master, and to remove
them to their proper heaps boys are employed by him at 1s. per day.
These boys are almost universally the children of dustmen and
sifters at work in the yard, and thus not only help to increase the
earnings of the family, but qualify themselves to become the
dustmen of a future day.
5th. The hill-man or hill-woman. The hill-man enters into an
agreement with the contractor to sift all the dust in the yard
throughout the year at so much per load and perquisites. The usual
sum per load is 6d., nor have I been able to ascertain that any of
these people undertake to do it at a less price. Such is the amount
paid by the contractor for Whitechapel. The perquisites of the hill-
man or hill-woman, are rags, bones, pieces of old metal, old tin or
iron vessels, old boots and shoes, and one-half of the money,
jewellery, or other valuables that may be found by the sifters.
The hill-man or hill-woman employs the following persons, and pays
them at the following rates.
1st. The sifters are paid 1s. per day when employed, but the
employment is not constant. The work cannot be pursued in wet
weather, and the services of the sifters are required only when a
large heap has accumulated, as they can sift much faster than the
dust can be collected. The employment is therefore precarious; the
payment has not, for the last 30 years at least, been more than 1s.
per day, but the perquisites were greater. They formerly were
allowed one-half of whatever was found; of late years, however, the
hill-man has gradually reduced the perquisites “first one thing and
then another,” until the only one they have now remaining is half of
whatever money or other valuable article may be found in the
process of sifting. These valuables the sifters often pocket, if able to
do so unperceived, but if discovered in the attempt, they are
immediately discharged.
2nd. “The fillers-in,” or shovellers of dust into the sieves of sifters,
are in general any poor fellows who may be straggling about in
search of employment. They are sometimes, however, the grown-up
boys of dustmen, not yet permanently engaged by the contractor.
These are paid 2s. per day for their labour, but they are considered
more as casualty men, though it often happens, if “hands” are
wanted, that they are regularly engaged by the contractors, and
become regular dustmen for the remainder of their lives.
3rd. The little fellows, the children of the dustmen, who follow their
mothers to the yard, and help them to pick rags, bones, &c., out of
the sieve and put them into the baskets, as soon as they are able to
carry a basket between two of them to the separate heaps, are paid
3d. or 4d. per day for this work by the hill-man.
The wages of the dustmen have been increased within the last
seven years from 6d. per load to 8d. among the large contractors—
the “small masters,” however, still continue to pay 6d. per load. This
increase in the rate of remuneration was owing to the men
complaining to the commissioners that they were not able to live
upon what they earned at 6d.; an enquiry was made into the truth
of the men’s assertion, and the result was that the commissioners
decided upon letting the contracts to such parties only as would
undertake to pay a fair price to their workmen. The contractors,
accordingly, increased the remuneration of the labourers; since then
the principal masters have paid 8d. per load to the collectors. It is
right I should add, that I could not hear—though I made special
enquiries on the subject—that the wages had been in any one
instance reduced since Free-trade has come into operation.
The usual hours of labour vary according to the mode of payment.
The “collectors,” or men out with the cart, being paid by the load,
work as long as the light lasts; the “fillers-in” and sifters, on the
other hand, being paid by the day, work the ordinary hours, viz.,
from six to six, with the regular intervals for meals.
The summer is the worst time for all hands, for then the dust
decreases in quantity; the collectors, however, make up for the
“slackness” at this period by nightwork, and, being paid by the
“piece” or load at the dust business, are not discharged when their
employment is less brisk.
It has been shown that the dustmen who perambulate the streets
usually collect five loads in a day; this, at 8d. per load, leaves them
about 1s. 8d. each, and so makes their weekly earnings amount to
about 10s. per week. Moreover, there are the “perquisites” from the
houses whence they remove the dust; and further, the dust-
collectors are frequently employed at the night-work, which is always
a distinct matter from the dust-collecting, &c., and paid for
independent of their regular weekly wages, so that, from all I can
gather, the average wages of the men appear to be rather more
than 15s. Some admitted to me, that in busy times they often
earned 25s. a week.
Then, again, dustwork, as with the weaving of silk, is a kind of
family work. The husband, wife, and children (unfortunately) all
work at it. The consequence is, that the earnings of the whole have
to be added together in order to arrive at a notion of the aggregate
gains.
The following may therefore be taken as a fair average of the
earnings of a dustman and his family when in full employment. The
elder boys when able to earn 1s. a day set up for themselves, and
do not allow their wages to go into the common purse.
£. s. d. £. s. d.
Man, 5 loads per day, or 30 loads per week, at 4d.
0 10 0
per load
Perquisites, or beer money 0 2 9½
Night-work for 2 nights a week 0 5 0
0 17 9½
Woman, or sifter, per week, at 1s. per day 0 6 0
Perquisites, say 3d. a day 0 1 6
0 7 6
Child, 3d. per day, carrying rags, bones, &c. —— 0 1 6
Total 1 6 9½
These are the earnings, it should be borne in mind, of a family in full
employment. Perhaps it may be fairly said that the earnings of the
single men are, on an average, 15s. a week, and 1l. for the family
men all the year round.
Now, when we remember that the wages of many agricultural
labourers are but 8s. a week, and the earnings of many
needlewomen not 6d. a day, it must be confessed that the
remuneration of the dustmen, and even of the dustwomen, is
comparatively high. This certainly is not due to what Adam Smith, in
his chapter on the Difference of Wages, terms the “disagreeableness
of the employment.” “The wages of labour,” he says, “vary with the
ease or hardship, the cleanliness or dirtiness, the honourableness or
dishonourableness, of the employment.” It will be seen—when we
come to treat of the nightmen—that the most offensive, and perhaps
the least honourable, of all trades, is far from ranking among the
best paid, as it should, if the above principle held good. That the
disagreeableness of the occupation may in a measure tend to
decrease the competition among the labourers, there cannot be the
least doubt, but that it will consequently induce, as political economy
would have us believe, a larger amount of wages to accrue to each
of the labourers, is certainly another of the many assertions of that
science which must be pronounced “not proven.” For the dustmen
are paid, if anything, less, and certainly not more, than the usual
rate of payment to the London labourers; and if the earnings rank
high, as times go, it is because all the members of the family, from
the very earliest age, are able to work at the business, and so add to
the general gains.
The dustmen are, generally speaking, an hereditary race; when
children they are reared in the dust-yard, and are habituated to the
work gradually as they grow up, after which, almost as a natural
consequence, they follow the business for the remainder of their
lives. These may be said to be born-and-bred dustmen. The
numbers of the regular men are, however, from time to time
recruited from the ranks of the many ill-paid labourers with which
London abounds. When hands are wanted for any special occasion
an employer has only to go to any of the dock-gates, to find at all
times hundreds of starving wretches anxiously watching for the
chance of getting something to do, even at the rate of 4d. per hour.
As the operation of emptying a dust-bin requires only the ability to
handle a shovel, which every labouring man can manage, all
workmen, however unskilled, can at once engage in the occupation;
and it often happens that the men thus casually employed remain at
the calling for the remainder of their lives. There are no houses of
call whence the men are taken on when wanting work. There are
certainly public-houses, which are denominated houses of call, in the
neighbourhood of every dust-yard, but these are merely the drinking
shops of the men, whither they resort of an evening after the labour
of the day is accomplished, and whence they are furnished in the
course of the afternoon with beer; but such houses cannot be said
to constitute the dustman’s “labour-market,” as in the tailoring and
other trades, they being never resorted to as hiring-places, but
rather used by the men only when hired. If a master have not
enough “hands” he usually inquires among his men, who mostly
know some who—owing, perhaps, to the failure of their previous
master in getting his usual contract—are only casually employed at
other places. Such men are immediately engaged in preference to
others; but if these cannot be found, the contractors at once have
recourse to the system already stated.
The manner in which the dust is collected is very simple. The “filler”
and the “carrier” perambulate the streets with a heavily-built high
box cart, which is mostly coated with a thick crust of filth, and drawn
by a clumsy-looking horse. These men used, before the passing of
the late Street Act, to ring a dull-sounding bell so as to give notice to
housekeepers of their approach, but now they merely cry, in a
hoarse unmusical voice, “Dust oy-eh!” Two men accompany the cart,
which is furnished with a short ladder and two shovels and baskets.
These baskets one of the men fills from the dust-bin, and then helps
them alternately, as fast as they are filled, upon the shoulder of the
other man, who carries them one by one to the cart, which is placed
immediately alongside the pavement in front of the house where
they are at work. The carrier mounts up the side of the cart by
means of the ladder, discharges into it the contents of the basket on
his shoulder, and then returns below for the other basket which his
mate has filled for him in the interim. This process is pursued till all
is cleared away, and repeated at different houses till the cart is fully
loaded; then the men make the best of their way to the dust-yard,
where they shoot the contents of the cart on to the heap, and again
proceed on their regular rounds.
The dustmen, in their appearance, very much resemble the
waggoners of the coal-merchants. They generally wear knee-
breeches, with ancle boots or gaiters, short dirty smockfrocks or
coarse gray jackets, and fantail hats. In one particular, however, they
are at first sight distinguishable from the coal-merchants’ men, for
the latter are invariably black from coal dust, while the dustmen, on
the contrary, are gray with ashes.
In their personal appearance the dustmen are mostly tall stalwart
fellows; there is nothing sickly-looking about them, and yet a
considerable part of their time is passed in the yards and in the
midst of effluvia most offensive, and, if we believe “zymotic
theorists,” as unhealthy to those unaccustomed to them;
nevertheless, the children, who may be said to be reared in the yard
and to have inhaled the stench of the dust-heap with their first
breath, are healthy and strong. It is said, moreover, that during the
plague in London the dustmen were the persons who carted away
the dead, and it remains a tradition among the class to the present
day, that not one of them died of the plague, even during its
greatest ravages. In Paris, too, it is well known, that, during the
cholera of 1849, the quarter of Belleville, where the night-soil and
refuse of the city is deposited, escaped the freest from the
pestilence; and in London the dustmen boast that, during both the
recent visitations of the cholera, they were altogether exempt from
the disease. “Look at that fellow, sir!” said one of the dust-
contractors to me, pointing to his son, who was a stout red-cheeked
young man of about twenty. “Do you see anything ailing about him?
Well, he has been in the yard since he was born. There stands my
house just at the gate, so you see he hadn’t far to travel, and when
quite a child he used to play and root away here among the dust all
his time. I don’t think he ever had a day’s illness in his life. The
people about the yard are all used to the smell and don’t complain
about it. It’s all stuff and nonsense, all this talk about dust-yards
being unhealthy. I’ve never done anything else all my days and I
don’t think I look very ill. I shouldn’t wonder now but what I’d be set
down as being fresh from the sea-side by those very fellows that
write all this trash about a matter that they don’t know just that
about;” and he snapped his fingers contemptuously in the air, and,
thrusting both hands into his breeches pockets, strutted about,
apparently satisfied that he had the best of the argument. He was,
in fact, a stout, jolly, red-faced man. Indeed, the dustmen, as a
class, appear to be healthy, strong men, and extraordinary instances
of longevity are common among them. I heard of one dustman who
lived to be 115 years; another, named Wood, died at 100; and the
well-known Richard Tyrrell died only a short time back at the
advanced age of 97. The misfortune is, that we have no large series
of facts on this subject, so that the longevity and health of the
dustmen might be compared with those of other classes.
In almost all their habits the Dustmen are similar to the
Costermongers, with the exception that they seem to want their
cunning and natural quickness, and that they have little or no
predilection for gaming. Costermongers, however, are essentially
traders, and all trade is a species of gambling—the risking of a
certain sum of money to obtain more; hence spring, perhaps, the
gambling propensities of low traders, such as costers, and Jew
clothes-men; and hence, too, that natural sharpness which
characterizes the same classes. The dustmen, on the contrary, have
regular employment and something like regular wages, and
therefore rest content with what they can earn in their usual way of
business.
Very few of them understand cards, and I could not learn that they
ever play at “pitch and toss.” I remarked, however, a number of
parallel lines such as are used for playing “shove halfpenny,” on a
deal table in the tap-room frequented by them. The great
amusement of their evenings seems to be, to smoke as many pipes
of tobacco and drink as many pots of beer as possible.
I believe it will be found that all persons in the habit of driving
horses, such as cabmen, ’busmen, stage-coach drivers, &c., are
peculiarly partial to intoxicating drinks. The cause of this I leave
others to determine, merely observing that there would seem to be
two reasons for it: the first is, their frequent stopping at public-
houses to water or change their horses, so that the idea of drinking
is repeatedly suggested to their minds even if the practice be not
expected of them; while the second reason is, that being out
continually in the wet, they resort to stimulating liquors as a
preventive to “colds” until at length a habit of drinking is formed.
Moreover, from the mere fact of passing continually through the air,
they are enabled to drink a greater quantity with comparative
impunity. Be the cause, however, what it may, the dustmen spend a
large proportion of their earnings in drink. There is always some
public-house in the neighbourhood of the dust-yard, where they
obtain credit from one week to another, and here they may be found
every night from the moment their work is done, drinking, and
smoking their long pipes—their principal amusement consisting in
“chaffing” each other. This “chaffing” consists of a species of
scurrilous jokes supposed to be given and taken in good part, and
the noise and uproar occasioned thereby increases as the night
advances, and as the men get heated with liquor. Sometimes the
joking ends in a general quarrel; the next morning, however, they
are all as good friends as ever, and mutually agree in laying the
blame on the “cussed drink.”
One-half, at least, of the dustmen’s earnings, is, I am assured,
expended in drink, both man and woman assisting in squandering
their money in this way. They usually live in rooms for which they
pay from 1s. 6d. to 2s. per week rent, three or four dust-men and
their wives frequently lodging in the same house. These rooms are
cheerless-looking, and almost unfurnished—and are always situate in
some low street or lane not far from the dust-yard. The men have
rarely any clothes but those in which they work. For their breakfast
the dustmen on their rounds mostly go to some cheap coffee-house,
where they get a pint or half-pint of coffee, taking their bread with
them as a matter of economy. Their midday meal is taken in the
public-house, and is almost always bread and cheese and beer, or
else a saveloy or a piece of fat pork or bacon, and at night they
mostly “wind up” by deep potations at their favourite house of call.
There are many dustmen now advanced in years born and reared at
the East-end of London, who have never in the whole course of their
lives been as far west as Temple-bar, who know nothing whatever of
the affairs of the country, and who have never attended a place of
worship. As an instance of the extreme ignorance of these people, I
may mention that I was furnished by one of the contractors with the
address of a dustman whom his master considered to be one of the
most intelligent men in his employ. Being desirous of hearing his
statement from his own lips I sent for the man, and after some
conversation with him was proceeding to note down what he said,
when the moment I opened my note-book and took the pencil in my
hand, he started up, exclaiming,—“No, no! I’ll have none of that
there work—I’m not such a b—— fool as you takes me to be—I
doesn’t understand it, I tells you, and I’ll not have it, now that’s
plain;”—and so saying he ran out of the room, and descended the
entire flight of stairs in two jumps. I followed him to explain, but
unfortunately the pencil was still in one hand and the book in the
other, and immediately I made my appearance at the door he took
to his heels, again with three others who seemed to be waiting for
him there. One of the most difficult points in my labours is to make
such men as these comprehend the object or use of my
investigations.
Among 20 men whom I met in one yard, there were only five who
could read, and only two out of that five could write, even
imperfectly. These two are looked up to by their companions as
prodigies of learning and are listened to as oracles, on all occasions,
being believed to understand every subject thoroughly. It need
hardly be added, however, that their acquirements are of the most
meagre character.
The dustmen are very partial to a song, and always prefer one of the
doggrel street ballads, with what they call a “jolly chorus” in which,
during their festivities, they all join with stentorian voices. At the
conclusion there is usually a loud stamping of feet and rattling of
quart pots on the table, expressive of their approbation.
The dustmen never frequent the twopenny hops, but sometimes
make up a party for the “theaytre.” They generally go in a body with
their wives, if married, and their “gals,” if single. They are always to
be found in the gallery, and greatly enjoy the melodramas performed
at the second-class minor theatres, especially if there be plenty of
murdering scenes in them. The Garrick, previous to its being burnt,
was a favourite resort of the East-end dustmen. Since that period
they have patronized the Pavilion and the City of London.
The politics of the dustmen are on a par with their literary
attainments—they cannot be said to have any. I cannot say that they
are Chartists, for they have no very clear knowledge of what “the
charter” requires. They certainly have a confused notion that it is
something against the Government, and that the enactment of it
would make them all right; but as to the nature of the benefits
which it would confer upon them, or in what manner it would be
likely to operate upon their interest, they have not, as a body, the
slightest idea. They have a deep-rooted antipathy to the police, the
magistrates, and all connected with the administration of justice,
looking upon them as their natural enemies. They associate with
none but themselves; and in the public-houses where they resort
there is a room set apart for the special use of the “dusties,” as they
are called, where no others are allowed to intrude, except
introduced by one of themselves, or at the special desire of the
majority of the party, and on such occasions the stranger is treated
with great respect and consideration.
As to the morals of these people, it may easily be supposed that
they are not of an over-strict character. One of the contractors said
to me, “I’d just trust one of them as far as I could fling a bull by the
tail; but then,” he added, with a callousness that proved the laxity of
discipline among the men was due more to his neglect of his duty to
them than from any special perversity on their parts, “that’s none of
my business; they do my work, and that’s all I want with them, and
all I care about. You see they’re not like other people, they’re reared
to it. Their fathers before them were dustmen, and when lads they
go into the yard as sifters, and when they grow up they take to the
shovel, and go out with the carts. They learn all they know in the
dust-yards, and you may judge from that what their learning is likely
to be. If they find anything among the dust you may be sure that
neither you nor I will ever hear anything about it; ignorant as they
are, they know a little too much for that. They know, as well as here
and there one, where the dolly-shop is; but, as I said before, that’s
none of my business. Let every one look out for themselves, as I do,
and then they need not care for any one.” [With such masters
professing such principles—though it should be stated that the
sentiments expressed on this occasion are but similar to what I hear
from the lower class of traders every day—how can it be expected
that these poor fellows can be above the level of the mere beasts of
burden that they use.] “As to their women,” continued the master, “I
don’t trouble my head about such things. I believe the dustmen are
as good to them as other men; and I’m sure their wives would be as
good as other women, if they only had the chance of the best. But
you see they’re all such fellows for drink that they spend most of
their money that way, and then starve the poor women, and knock
them about at a shocking rate, so that they have the life of dogs, or
worse. I don’t wonder at anything they do. Yes, they’re all married,
as far as I know; that is, they live together as man and wife, though
they’re not very particular, certainly, about the ceremony. The fact is,
a regular dustman don’t understand much about such matters, and,
I believe, don’t care much, either.”
From all I could learn on this subject, it would appear that, for one
dustman that is married, 20 live with women, but remain constant to
them; indeed, both men and women abide faithfully by each other,
and for this reason—the woman earns nearly half as much as the
man. If the men and women were careful and prudent, they might, I
am assured, live well and comfortable; but by far the greater portion
of the earnings of both go to the publican, for I am informed, on
competent authority, that a dustman will not think of sitting down
for a spree without his woman. The children, as soon as they are
able to go into the yard, help their mothers in picking out the rags,
bones, &c., from the sieve, and in putting them in the basket. They
are never sent to school, and as soon as they are sufficiently strong
are mostly employed in some capacity or other by the contractor,
and in due time become dustmen themselves. Some of the children,
in the neighbourhood of the river, are mud-larks, and others are
bone-grubbers and rag-gatherers, on a small scale; neglected and
thrown on their own resources at an early age, without any but the
most depraved to guide them, it is no wonder to find that many of
them turn thieves. To this state of the case there are, however, some
few exceptions.
Some of the dustmen are prudent well-behaved men and have
decent homes; many of this class have been agricultural labourers,
who by distress, or from some other cause, have found their way to
London. This was the case with one whom I talked with: he had
been a labourer in Essex, employed by a farmer named Izzod, whom
he spoke of as being a kind good man. Mr. Izzod had a large farm on
the Earl of Mornington’s estate, and after he had sunk his capital in
the improvement of the land, and was about to reap the fruits of his
labour and his money, the farmer was ejected at a moment’s notice,
beggared and broken-hearted. This occurred near Roydon, in Essex.
The labourer, finding it difficult to obtain work in the country, came
to London, and, discovering a cousin of his engaged in a dust-yard,
got employed through him at the same place, where he remains to
the present day. This man was well clothed, he had good strong lace
boots, gray worsted stockings, a stout pair of corduroy breeches, a
short smockfrock and fantail. He has kept himself aloof, I am told,
from the drunkenness and dissipation of the dustmen. He says that
many of the new hands that get to dustwork are mechanics or
people who have been “better off,” and that these get thinking about
what they have been, till to drown their care they take to drinking,
and often become, in the course of a year or so, worse than the “old
hands” who have been reared to the business and have “nothing at
all to think about.”
Among the dustmen there is no “Society” nor “Benefit Club,”
specially devoted to the class—no provident institution whence they
can obtain “relief” in the event of sickness or accident. The
consequence is that, when ill or injured, they are obliged to obtain
letters of admission to some of the hospitals, and there remain till
cured. In cases of total incapacity for labour, their invariable refuge
is the workhouse; indeed they look forward (whenever they foresee
at all) to this asylum as their resting-place in old age, with the
greatest equanimity, and talk of it as “the house” par excellence, or
as “the big house,” “the great house,” or “the old house.” There are,
however, scattered about in every part of London numerous benefit
clubs made up of working-men of every description, such as Old
Friends, Odd Fellows, Foresters, and Birmingham societies, and with
some one or other of these the better class of dustmen are
connected. The general rule, however, is, that the men engaged in
this trade belong to no benefit club whatever, and that in the season
of their adversity they are utterly unprovided for, and consequently
become burdens to the parishes wherein they happen to reside.
I visited a large dust-yard at the east end of London, for the purpose
of getting a statement from one of the men. My informant was, at
the time of my visit, shovelling the sifted soil from one of the lesser
heaps, and, by a great effort of strength and activity, pitching each
shovel-full to the top of a lofty mound, somewhat resembling a
pyramid. Opposite to him stood a little woman, stoutly made, and
with her arms bare above the elbow; she was his partner in the
work, and was pitching shovel-full for shovel-full with him to the
summit of the heap. She wore an old soiled cotton gown, open in
front, and tucked up behind in the fashion of the last century. She
had clouts of old rags tied round her ancles to prevent the dust from
getting into her shoes, a sort of coarse towel fastened in front for an
apron, and a red handkerchief bound tightly round her head. In this
trim she worked away, and not only kept pace with the man, but
often threw two shovels for his one, although he was a tall, powerful
fellow. She smiled when she saw me noticing her, and seemed to
continue her work with greater assiduity. I learned that she was
deaf, and spoke so indistinctly that no stranger could understand
her. She had also a defect in her sight, which latter circumstance had
compelled her to abandon the sifting, as she could not well
distinguish the various articles found in the dust-heap. The poor
creature had therefore taken to the shovel, and now works with it
every day, doing the labour of the strongest men.
From the man above referred to I obtained the following statement:
—“Father vos a dustie;—vos at it all his life, and grandfather afore
him for I can’t tell how long. Father vos allus a rum ’un;—sich a
beggar for lush. Vhy I’m blowed if he vouldn’t lush as much as half-
a-dozen on ’em can lush now; somehow the dusties hasn’t got the
stuff in ’em as they used to have. A few year ago the fellers ’u’d
think nothink o’ lushin avay for five or six days without niver going
anigh their home. I niver vos at a school in all my life; I don’t know
what it’s good for. It may be wery well for the likes o’ you, but I
doesn’t know it ’u’d do a dustie any good. You see, ven I’m not out
with the cart, I digs here all day; and p’raps I’m up all night, and
digs avay agen the next day. Vot does I care for reading, or anythink
of that there kind, ven I gets home arter my vork? I tell you vot I
likes, though! vhy, I jist likes two or three pipes o’ baccer, and a pot
or two of good heavy and a song, and then I tumbles in with my
Sall, and I’m as happy as here and there von. That there Sall of
mine’s a stunner—a riglar stunner. There ain’t never a voman can sift
a heap quickerer nor my Sall. Sometimes she yarns as much as I
does; the only thing is, she’s sitch a beggar for lush, that there Sall
of mine, and then she kicks up sitch jolly rows, you niver see the like
in your life. That there’s the only fault, as I know on, in Sall; but,
barring that, she’s a hout-and-houter, and worth a half-a-dozen of t’
other sifters—pick ’em out vare you likes. No, we ain’t married
’zactly, though it’s all one for all that. I sticks to Sall, and Sall sticks
to I, and there’s an end on’t:—vot is it to any von? I rec’lects a-
picking the rags and things out of mother’s sieve, when I were a
young ’un, and a putting ’em all in the heap jist as it might be there.
I vos allus in a dust-yard. I don’t think I could do no how in no other
place. You see I vouldn’t be ’appy like; I only knows how to vork at
the dust ’cause I’m used to it, and so vos father afore me, and I’ll
stick to it as long as I can. I yarns about half-a-bull [2s. 6d.] a day,
take one day with another. Sall sometimes yarns as much, and ven I
goes out at night I yarns a bob or two more, and so I gits along
pretty tidy; sometimes yarnin more and sometimes yarnin less. I
niver vos sick as I knows on; I’ve been queerish of a morning a good
many times, but I doesn’t call that sickness; it’s only the lush and
nothink more. The smells nothink at all, ven you gits used to it. Lor’
bless you! you’d think nothink on it in a veek’s time,—no, no more
nor I do. There’s tventy on us vorks here—riglar. I don’t think there’s
von on ’em ’cept Scratchey Jack can read, but he can do it stunning;
he’s out vith the cart now, but he’s the chap as can patter to you as
long as he likes.”
Concerning the capital and income of the London dust business, the
following estimate may be given as to the amount of property
invested in and accruing to the trade.
It has been computed that there are 90 contractors, large and small;
of these upwards of two-thirds, or about 35, may be said to be in a
considerable way of business, possessing many carts and horses, as
well as employing a large body of people; some yards have as many
as 150 hands connected with them. The remaining 55 masters are
composed of “small men,” some of whom are known as “running
dustmen,” that is to say, persons who collect the dust without any
sanction from the parish; but the number belonging to this class has
considerably diminished since the great deterioration in the price of
“brieze.” Assuming, then, that the great and little master dustmen
employ on an average between six and seven carts each, we have
the following statement as to the
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookultra.com