Professional JavaScript for Web Developers 1st Edition Nicholas C. Zakas - The ebook is available for instant download, no waiting required
Professional JavaScript for Web Developers 1st Edition Nicholas C. Zakas - The ebook is available for instant download, no waiting required
com
https://ebookname.com/product/professional-javascript-for-
web-developers-1st-edition-nicholas-c-zakas/
OR CLICK HERE
DOWLOAD EBOOK
https://ebookname.com/product/professional-ajax-2nd-edition-
programmer-to-programmer-nicholas-c-zakas/
https://ebookname.com/product/security-for-web-developers-using-
javascript-html-and-css-early-release-raw-unedited-john-paul-
mueller/
https://ebookname.com/product/pro-javascript-for-web-apps-1st-
edition-adam-freeman/
https://ebookname.com/product/perception-of-faces-objects-and-
scenes-analytic-and-holistic-processes-advances-in-visual-
cognition-1st-edition-mary-a-peterson/
The Complete Guide to Fasting Heal Your Body Through
Intermittent Alternate Day and Extended 1st Edition
Jason Fung
https://ebookname.com/product/the-complete-guide-to-fasting-heal-
your-body-through-intermittent-alternate-day-and-extended-1st-
edition-jason-fung/
https://ebookname.com/product/industrial-commodity-statistics-
yearbook-2005-production-statistics-1996-2005-united-nations/
https://ebookname.com/product/electrocorrosion-and-protection-of-
metals-general-approach-with-particular-consideration-to-
electrochemical-plants-1st-edition-joseph-riskin/
https://ebookname.com/product/ljmu-law-year-one-optimize-english-
legal-system-1st-edition-angela-stanhope/
https://ebookname.com/product/microelectronics-failure-analysis-
desk-reference-6th-edition-edition-edfas-desk-reference-
committee/
Bangladesh s Quest for Inclusive Development Challenges
and Pathways 1st Edition Mustafa K. Mujeri
https://ebookname.com/product/bangladesh-s-quest-for-inclusive-
development-challenges-and-pathways-1st-edition-mustafa-k-mujeri/
Professional JavaScript™ for Web Developers
Professional JavaScript™ for Web Developers
Nicholas C. Zakas
Professional JavaScript™ for Web Developers
Copyright © 2005 by Wiley Publishing Inc. All rights reserved.
Published by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form
or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, except as
permitted under Section 107 or 108 of the 1976 United States Copyright Act, without either the prior
written permission of the Publisher, or authorization through payment of the appropriate per-copy fee
to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax
(978) 646-8700. Requests to the Publisher for permission should be addressed to the Legal Department,
Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317) 572-3447, fax (317)
572-4355, or online at www.wiley.com/go/permissions.
For general information on our other products and services please contact our Customer Care Depart-
ment within the United States at (800) 762-2974, outside the United States at (317) 572-3993 or fax (317)
572-4002.
Trademarks: Wiley, the Wiley Publishing logo, Wrox, the Wrox logo, and Programmer to Programmer
are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates. JavaScript is a
trademark of Sun Microsystems, Inc. in the United States and other countries. All other trademarks are
the property of their respective owners. Wiley Publishing, Inc., is not associated with any product or
vendor mentioned in this book.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print
may not be available in electronic books.
Library of Congress Cataloging-in-Publication Data is available from the publisher.
ISBN-13: 978-0-7645-7908-0
ISBN-10: 0-7645-7908-8
Printed in the United States of America
10 9 8 7 6 5 4 3 2 1
About the Author
Nicholas C. Zakas is a user interface designer for Web applications, specializing in client-side technolo-
gies such as JavaScript, HTML, and CSS. Nicholas currently works as Senior Software Engineer, Design
Engineering, at MatrixOne, Inc. located in Westford, Massachusetts, USA.
Nicholas has a B.S. in Computer Science from Merrimack College, where he learned traditional pro-
gramming in C and C++. During college, he began investigating the World Wide Web and HTML in his
spare time, eventually teaching himself enough to be hired as Webmaster of a small software company
named Radnet, Inc. in Wakefield, Massachusetts, USA. It was there that Nicholas began learning
JavaScript and working on Web applications.
It takes more than just one person to write a book of this nature, despite the single name on the front
cover. Without the help of numerous individuals, this book would not have been possible.
First are foremost, thanks to everyone at Wiley Publishing, especially Jim Minatel and Sharon Nash, for
providing all the guidance and support that a new author needs.
Thanks to all those who offered their ideas on what a good JavaScript book should include: Keith
Ciociola, Ken Fearnley, John Rajan, and Douglas Swatski.
A special thanks to everyone who reviewed the subject matter ahead of time: Erik Arvidsson, Bradley
Baumann, Guilherme Blanco, Douglas Crockford, Jean-Luc David, Emil A. Eklund, Brett Fielder, Jeremy
McPeak, and Micha Schopman. All your input was excellent and made for a much better book.
Thanks to Drs. Ed and Frances Bernard for keeping me in tip-top health during the writing of this book
and the past few years.
Last, but certainly not least, thanks to my family, mom, dad, and Greg, and my extremely understanding
girlfriend, Emily. Your love and support helped take me from the proposal to the final published copy.
vii
Contents
Acknowledgments vii
Introduction xxi
ix
Contents
The String class 29
The instanceof operator 32
Operators 33
Unary operators 33
Bitwise operators 37
Boolean operators 43
Multiplicative operators 46
Additive operators 47
Relational operators 49
Equality operators 50
Conditional operator 52
Assignment operators 52
Comma operator 53
Statements 53
The if statement 53
Iterative statements 54
Labeled statements 56
The break and continue statements 56
The with statement 58
The switch statement 58
Functions 59
No overloading 61
The arguments object 62
The Function class 63
Closures 65
Summary 66
x
Contents
Scope 88
Public, protected, and private 88
Static is not static 88
The this keyword 89
Defining Classes and Objects 90
Factory paradigm 90
Constructor paradigm 92
Prototype paradigm 93
Hybrid constructor/prototype paradigm 94
Dynamic prototype method 95
Hybrid factory paradigm 96
Which one to use? 97
A practical example 97
Modifying Objects 99
Creating a new method 99
Redefining an existing method 100
Very late binding 101
Summary 102
xi
Contents
JavaScript in SVG 133
Basic SVG 133
The <script/> tag in SVG 134
Tag placement in SVG 135
The Browser Object Model 136
The window object 136
The document object 149
The location object 153
The navigator object 155
The screen object 156
Summary 157
xii
Contents
Simple Patterns 197
Metacharacters 197
Using special characters 197
Character classes 199
Quantifiers 201
Complex Patterns 205
Grouping 205
Backreferences 206
Alternation 207
Non-capturing groups 209
Lookaheads 210
Boundaries 210
Multiline mode 212
Understanding the RegExp Object 212
Instance properties 213
Static properties 214
Common Patterns 216
Validating dates 216
Validating credit cards 218
Validating e-mail addresses 222
Summary 223
xiii
Another Random Document on
Scribd Without Any Related Topics
infrequent vessel, gentle though her progress may be through the
calm waters of the tropics, still strikes them as an intruder upon this
realm of silence and loneliness. The voices of the crew grate harshly
upon the ear as with a sense of desecration such as one feels upon
hearing loud conversation in the sacred peace of some huge
cathedral. And when a vessel heaves in sight, a tiny mark against
the skyline, she but punctuates the loneliness, as it were—affords a
point from which the eye can faintly calculate the immensity of her
surroundings.
Quite differently, yet with its own distinctive privacy, do the stormy
regions of the ocean impress the beholder. In the fine zones the
wind’s presence is suggested rather than felt, so quiet and placid are
its manifestations. Its majestic voice is hushed into a murmur
undistinguishable from the musical rippling of the wavelets into
which it ruffles the shining sea-surface. But when beyond those
regions of perpetual summer the great giant Boreas asserts himself
and challenges his ancient colleague and competitor to a renewal of
the eternal conflict for supremacy, there is an overwhelming sense of
duality which is entirely absent in calmer seas. As the furious
tempest rages unappeasable, and the solemn ocean wakes in mighty
wrath, men must feel that to be present at such a quarrel is to be
like some puny mortal eavesdropping in full Sanhedrim of the High
Gods. Apart altogether from the imminent danger of annihilation,
there is that sense of intrusion which is almost sacrilege, of daring
thus to witness what should surely be hidden from the profane eyes
of the sons of men. All thoughtful minds are thus impressed by the
combat of gale and sea, although their impressions are for the most
part so elusive and shadowy that any definite fixing thereof is
hopeless. Especially is this form of the solemn privacy of the sea
noticeable in the Southern Ocean. Along the line, untraced by mortal
hand except upon a Mercator’s Chart, favoured by the swift sailing
ships between South America and Australasia, the vastest stretch of
ocean known is dotted only at enormous intervals by the fleets of
civilisation. Day succeeds day, lengthening into weeks, during which
the brave intruder is hurled upon her headlong way at the rate of
eight or nine degrees of longitude in the twenty-four hours without a
companion, with no visible environment but sea and sky. And do
what the intelligent novice will, he cannot divest himself of the
notion, when drawing near the confines of New Zealand, seeing how
minute that beautiful cluster of islands appears upon the chart, that
it would be so easy to miss them altogether, to rush past them
under compulsion of the mighty west wind, and waste long painful
days struggling against its power to get back again to the overrun
port.
Once in the writer’s own experience an incident occurred that
seemed almost to justify such a fear. Only sixty days had elapsed
since leaving Plymouth with four hundred emigrants on board, and
during the last fortnight the west wind had blown with terrific
violence (to a landsman). But the master, in calmest satisfaction,
with fullest confidence in the power of his ship, had steadfastly
refused to shorten sail. He seldom left the deck, the spectacle of his
beautiful command in her maddened rush to the east being to him
apparently sufficient recompense for loss of rest. At last we flew past
the Snares, those grim outliers of the Britain of the South, and it
became necessary to “haul up” for Port Lyttelton. To do this we must
needs bring that great wind full upon our broadside, and that, with
the canvas we were carrying, would have meant instant destruction.
So all hands were called, and the work of shortening her down
commenced. Several of the lighter sails, at the first slackening from
their previously rigid tension, gave one despairing flap and vanished
to join the clouds. But furious toil and careful skill through long
hours of that dense night succeeded in reducing the previously great
sail area down to three lower-topsails, reefed fore-sail, and fore-
topmast staysail. Then after much careful watching of the waves
that came fatefully thundering on astern until a lull momentarily
intervened, the helm was suddenly put down, and the gallant vessel
swung up into the wind. Nobly done, but as she wheeled there arose
out of the blackness ahead a mountainous shape with a voice that
made itself heard above the gale. Higher and higher it soared until
smiting the bluff of the bow it broke on board, a wave hundreds of
tons in solid weight. The stout steel ship trembled to her keelson,
but she rose a conqueror, while the avalanche of white-topped water
rushed aft dismantling the decks, and leaving them, when it had
subsided, in forlorn ruin. But she was safe. Justifying the faithfulness
and skill of her builders, she had survived where a weaker ship
would have disappeared, beaten out of the upper air like a paper
boat under a stone flung from the bank. Slowly and laboriously we
fore-reached to the northward, until under the lee of the land the
wind changed, and we entered port in triumph.
This sense of solitude induced by contemplation of the ocean is
exceedingly marked even on the best frequented routes and the
most crowded (?) waters. To enter into it fully, however, it is
necessary to sail either in a cable ship, a whaler, or an old slow-
going merchant sailor that gets drifted out of the track of vessels.
Even in the English Channel one cannot but feel how much room
there is. In spite of our knowledge of the numbers of ships that pass
and repass without ceasing along what may truthfully be termed the
most frequented highway in the watery world, there is an
undoubtedly reasonable sense induced by its contemplation that
however much the dry land may become overcrowded the sea will
always be equal to whatever demands may be made upon it for
space. There are many harbours in the world, at any rate landlocked
bays that may rightly be called harbours, wherein the fleets of all the
nations might lie in comfort. And their disappearance from the open
sea would leave no sense of loss. So wide is Old Ocean’s bosom.
Perhaps this is even now more strongly marked than it was fifty
years ago. The wonderful exactitude with which the steam fleets of
the world keep to certain well-defined tracks leaves the intermediate
breadths unvisited from year to year. They are private places whither
he who should desire to hide himself from the eyes of men might hie
and be certain that but for the host of heaven, the viewless wind,
and the silent myriads beneath, he would indeed be alone. They are
of the secret places of the Almighty.
Occasionally the great steamships that lay for us the connecting
nerves of civilisation penetrate these arcana, for their path must be
made on the shortest line between two continents, heedless of
surface tracks. And the wise men who handle these wonderful
handmaids of science know how private are the realms through
which they steadily steam, leaving behind them the thin black line
along which shall presently flash at lightning speed the thought-
essence of mankind. The whaler, alas! is gone; the old leisurely
South Seaman to whom time was a thing of no moment. Her ruler
knew that his best prospect of finding the prey he sought was where
no keel disturbed the sensitive natural vibrations of the wave. So
these vessels saw more of sea solitude than any others. Saw those
weird spaces unvisited even by wind, great areas of silky surface
into whose peaceful glades hardly rolled a gently undulating swell
bearing silent evidence of storms raging half a world away. So too
upon occasion did, and does, a belated sailing-ship, such as one we
met in the Southern Seas bound from the United Kingdom to
Auckland, that had been then nine months on her passage. Into
what dread sea-solitudes she had intruded. How many, many days
had elapsed during which she was the solitary point rising from the
shining plain into the upper air. Her crew had a wistful look upon
their faces, as of men whose contact with the world they dimly
remembered had been effectually cut off. And truly to many, news of
her safety came in the nature of a message of resurrection. Books of
account concerning her had to be reopened, mourning garments laid
aside. She had returned from the silences, had rejoined the world of
men.
All the tracks along which ships travel are but threads traversing
these private waters, just little spaces like a trail across an illimitable
desert. And even there the simile fails because the track across the
ocean plain is imaginary. It is traced by the passing keel and
immediately it is gone. And the tiny portion of the sea-surface thus
furrowed is but the minutest fraction of the immeasurable spaces
wherein is enthroned the privacy of the sea.
THE VOICES OF THE SEA
Not the least of the many charms exercised by the deep and wide
sea upon its bond-servants are the varied voices by which it makes
known its ever-changing moods. They are not for all ears to hear.
Many a sailor spends the greater part of a long life in closest
intercourse with the ocean, yet to its myriad beauties he is blind; no
realised sense of his intimacy with the immensity of the Universe
ever makes the hair of his flesh stand up, and to the majestic music
of the unresting deep his ears of appreciation are closely sealed. Not
that unto any one of the sons of men is it ever given to be
conversant with all the countless phases of delight belonging to the
sea. For some cannot endure the call of deep answering unto deep,
the terrible thundering of the untrammelled ocean in harmony with
the uttermost diapason of the storm-wind. All their finer perceptions
are benumbed by fear. And other some, who are yet unable to
rejoice in the sombre glory of the tempest-tones, are intolerant of
the lightsome glee born of zephyrs and sunlight when the sweet
murmur of the radiant breaths is like the contented cooing of care-
free infancy, and every dancing wavelet wears a many-dimpled
smile. For them there must be a breeze of strength with a strident,
swaggering sea through which the well-found ship ploughs her
steady way at utmost speed with every rounded sail distent like a
cherub’s cheek, and every rope and stay humming a merry tune.
Least of all in number are those who can enjoy a perfect calm.
Indeed, in these bustling, strenuous days of ours opportunities of so
doing are daily becoming fewer. The panting steamship tears up the
silken veil of the slumbering sea like some envious monster in a
garden of sleep making havoc of its beauty. She makes her own
wind by her swift thrust through the restful atmosphere, although
there be in reality none astir even sufficient to ruffle the shining
surface before her.
Still, the fact must not be overlooked that many sea-farers do
verily enjoy to the full all sea-sights and sea-sounds, but of their
pleasures they cannot speak. Deep silent content is theirs, a perfect
complacency of delight that length of acquaintanceship only makes
richer and more satisfying, until, as the very structure of the
Stradivarius is saturated with music, so the mariner’s whole being
absorbs, and becomes imbued with, the magic of wind and wave.
This incommunicable joy a monarch might well envy its possessor,
for it is independent of environment, so that although the seafarer
may grow old and feeble, be far away from his well-beloved sea,
even blind and deaf, yet within his soul will still vibrate those
resounding harmonies, and with inward eyes he can feast a farther-
reaching vision than ever over those glorious fenceless fields.
The voices of the sea are many, but their speech is one. Naturally,
perhaps, the thought turns first to the tremendous chorus uplifted in
the hurricane, that swells and swells until even the tropical thunder’s
deafening cannonade is unheard, drowned deep beneath the
exultant flood of song poured forth by the rejoicing sea. Many
epithets have been chosen to characterise the storm-song of the
ocean. None of them can ever hope to satisfy completely, for all
must bear some definite reflex of the minds of their utterers,
according as they have been impressed by their experiences or
imaginings. But to my mind most of the terms used are out of place
and misleading. They generally endeavour to describe the
tempestuous sea as a ravenous monster, a howling destroyer of
unthinking ferocity, and the like. Alas, it is very natural so to do. For
when this feeble frame must needs confront the resounding main in
the plenitude of its power, our mortal part must perforce feel and
acknowledge its insignificance, must dwindle and shake with fear,
although that part of us which is akin to the Infinite may vainly
desire to rejoice with all seas and floods that praise Him and magnify
Him for ever. Not in the presence of ocean shouting his hymn of
praise may we satisfy our desire to join in the triumphant lay,
although we know how full of benefits to our race are the forces
made vocal in that majestic Lobgesang. As the all-conquering flood
of sound, with a volume as if God were smiting the sapphire globe of
the universe, rolls on, we may hear the cry, “Life and strength and
joy do I bring. Before my resistless march darkness, disease, and
death must flee. When beneath my reverberating chariot-wheels
man is overwhelmed, not mine the blame. I do but fulfil mine
appointed way, scattering health, refreshment, and well-being over
every living thing.”
But when as yet the sky is serene above and the surface of the
slumbering depths is just ruffled by a gentle air, there may often be
heard another voice, as if some gigantic orchestra in another star
was preparing for the signal to burst forth into such music as
belongs not to our little planet. Fitful wailing notes in many keys,
long sustained and all minor, encompass the voyager without and
within. Now high, now low, but ever tending to deepen and become
more massive in tone, this unearthly symphony is full of warning. It
bids the watchful seaman make ready against the advent of the fast
approaching storm, that, still some hundreds of leagues distant, is
sending its pursuivants before its face. Nor are these spirit-stirring
chords due to the harp-like obstruction offered by the web of rigging
spread about the masts of a ship to the rising wind. It may be heard
even more definitely in an open boat far from any ship or shore,
although there, perhaps because of the great loneliness of the
situation, it always seems to take a tone of deeper melancholy, as if
in sympathy with the helplessness of the human creatures thus
isolated from their fellows. It belongs, almost exclusively, to the
extra-tropical regions where storms are many. And within a certain
compass, its intimates find little variation of its scale. Always
beginning in the treble clef and by regular melodic waves gradually
descending until with the incidence of the storm it blends into the
grand triumphal march spoken of before. But when it is heard within
the tropics let the mariner beware. None can ever mistake its weird
lament, sharpening every little while into a shrill scream as if
impatient that its warning should be heeded without delay. It
searches the very marrow of the bones, and beasts as well as men
look up and are much afraid. For it is the precursor of the hurricane,
before which the bravest seaman blanches, when sea and sky seem
to meet and mingle, the waters that are above the firmament with
the waters that are under the firmament, as in the days before God
said “Let there be light.”
Far different again is the cheerful voice of the Trade wind over the
laughing happy sea of those pleasant latitudes. No note of sadness
or melancholy is to be detected there. Brisk and bright, confident
and gay, it bids the sailor be glad in his life. Bids him mark anew
how beautiful is the bright blue sea, how snowy are the billowy
clouds piled peacefully around the horizon, while between them and
the glittering edge of the vast circle shows a tender band of greyish
green of a lucent clearness that lets the rising stars peep through as
soon as they are above the horizon. Overhead through all the infinite
fleckless dome eddy the friendly tones. Yet so diffused are they, so
vast in their area that if one listen for them he cannot hear aright—
they must be felt rather than heard. Well may their song be of
content and good cheer. For they course about their ordained orbits
as the healthful life tides through the human body, keeping sweet all
adjacent shores and preventing by their beneficent agitation a
baleful stagnation of the sea. By day the golden sun soars on his
splendid road from horizon to zenith until he casts no shadow, and
all the air quivers with living light, then in stately grandeur sinks
through the pure serenity of that perfect scene, the guardian cumuli
clustering round his goal melting apart so that, visible to the last of
his blazing verge, he may go as he came, unshadowed by haze or
cloud. Then, as the radiant train of lovely rays fade reluctantly from
the blue concave above, all the untellable splendours of the night
come forth in their changeless order, their scintillating lustre
undimmed by the filmiest veil of haze. One incandescent
constellation after another is revealed until, as the last faint sheen of
the departing day disappears from the western horizon, the double
girdle of the galaxy is flung across the darkling dome in all its
wondrous beauty. And unceasingly through all the succeeding
beauties of the day and night that flood of happy harmony rolls on.
How shall I speak of the voice of the calm? How describe that
sound which mortal ear cannot hear? The pen of the inspired writers
alone might successfully undertake such a task, so closely in touch
as they were with the Master Mind. “When the morning stars sang
together, and all the Sons of God shouted for joy.” Something akin to
this sublime daring of language is needed to convey a just idea of
what floods the soul when alone upon the face of the deep in a
perfect calm. The scale of that heavenly harmony is out of our
range. We can only by some subtle alchemy of the brain distil from
that celestial silence the voices of angels and archangels and all the
glorious company of heaven. Between us and them is but a step, but
it is the threshold of the timeless dimension. Again and again I have
seen men, racked through and through with a very agony of delight,
dash aside the thralls that held them, sometimes with passionate
tears, more often with raging words that grated harshly upon the
velvet stillness. They felt the burden of the flesh grievous, since it
shut them out from what they dimly felt must be bliss unutterable,
not to be contained in any earthen vessel. On land a thousand
things, even in a desert, distract the attention, loose the mind’s
tension even when utterly alone. But at sea, the centre of one vast
glassy circle, shut in on every hand by a perfect demi-globe as
flawless as the mirror whereon you float, with even the softest
undulation imperceptible, and no more motion of the atmosphere
than there is in a perfect vacuum, there is absolutely nothing to
come between the Soul of Man and the Infinite Silences of Creation.
There and there only is it possible to realise what underlies that
mighty line, “There was silence in Heaven for the space of half-an-
hour.” Few indeed are the men, however rough and unthinking, that
are not quieted and impressed by the marvel of a perfect calm. But
the tension is too great to be borne long with patience. Men feel that
this majestic environment is too redolent of the coming paradise to
be supportable by flesh and blood. They long with intense desire for
a breeze, for motion, for a change of any sort. So much so that long-
continued calm is dreaded by seamen more than any other phase of
sea-experience. And yet it is for a time lovely beyond description,
soothing the jarring nerves and solemnising every faculty as if one
were to be shut in before the Shekinah in the Holy of Holies. It is like
the Peace of God.
Thus far I have feebly attempted to deal with some of the sea-
voices untinctured by any contact with the land. But although the
interposition of rock and beach, cliff and sand-bank introduces fresh
changes with every variation of weather, new combinations of sound
that do not belong solely to the sea, any description of the sea-
music that should take no account of them would be manifestly one-
sided and incomplete. And yet the mutabilities are so many, the
gamut is so extended that it is impossible to do more than just take
a passing note of a few characteristic impressions. For every lonely
reef, every steep-to shore has an infinite variety of responses that it
gives back to the besieging waves. Some of them are terrible
beyond the power of words to convey. When the sailor in a crippled
craft, his reckoning unreliable, and his vigour almost gone by a long-
sustained struggle with the storm, hears to leeward the crashing
impact of mountainous waves against the towering buttresses of
granite protecting a sea-beset land, it is to him a veritable knell of
doom. Or when through the close-drawn curtains of fog comes the
hissing tumult of breaking seas over an invisible bank, interpolated
with the hoarse bellowing of the advancing flood checked in its free
onward sweep, bold and high indeed must be the courage that does
not fail. The lonely lighthouse-keeper on the Bishop Rock during the
utmost stress of an Atlantic gale notes with quickening pulse the
change of tone as the oncoming sea, rolling in from freedom, first
feels beneath it the outlying skirts of the solitary mountain. Nearer
and deeper and fiercer it roars until, with a shock that makes the
deep-rooted foundations of the rocks tremble, and the marvellous
fabric of dovetailed stone sway like a giant tree, it breaks, hurling its
crest high through the flying spindrift over the very finial of the
faithful tower.
But on the other hand, on some golden afternoon among the
sunny islands of summer seas, hear the soft soothing murmur of the
gliding swell upon the slumbering shore. It fills the mind with rest.
Sweeter than lowest lullaby, it comforts and composes, and even in
dreams it laps the sleeper in Elysium. The charm of that music is
chief among all the influences that bind the memory to those
Enchanted Isles. It returns again and again under sterner skies,
filling the heart with almost passionate longing to hear it, to feel it in
all its mystery once again. Still when all has been said, every dweller
on the sea-shore knows the voice of his own coast best. For him it
has its special charm, whether it shriek around ice-laden rocks, roar
against iron-bound cliffs, thunder over jagged reefs, or babble
among fairy islets. And yet all these many voices are but one.
T H E C A L L I N G O F C A P TA I N R A M I R E Z
When two whale-ships meet during a cruise, if there are no signs of
whales near, an exchange of visits always takes place. The two
captains foregather on board one ship, the two chief mates on board
the other. While the officers are thus enjoying themselves, it is usual
for the boats’ crews to go forrard and while away the time as best
they can, such visitors being always welcome. This practice is called
“gamming,” and is fruitful of some of the queerest yarns imaginable,
as these sea-wanderers ransack their memories for tales wherewith
to make the time pass pleasantly.
On the occasion of which I am writing, our ship had met the Coral
of Martha’s Vineyard off Nieuwe, and gamming had set in
immediately. One of the group among whom I sat was a sturdy little
native of Guam, in the Ladrone Islands, the picture of good-humour,
but as ugly as a Joss. Being called upon for a song, he laughingly
excused himself on the ground that his songs were calculated to
give a white man collywobbles; but if we didn’t mind he would spin a
“cuffer” (yarn) instead. Carried unanimously—and we lit fresh pipes
as we composed ourselves to hear of “The Calling of Captain
Ramirez.” I reproduce the story in a slightly more intelligible form
than I heard it, the mixture of Spanish, Kanaka, &c., being a
gibberish not to be understood by any but those who have lived
among the polyglot crowd in a whaler.
“About fifteen years ago now, as near as I can reckon (for we
don’t keep much account of time except we’re on monthly wage), I
was cruising the Kingsmills in the old Salem, Captain Ramirez. They
told me her name meant ‘Peace,’ and that may be; but if so, all I can
say is that never was a ship worse named. Why, there wasn’t ever
any peace aboard of her. Quiet there was, when the old man was
asleep, for nobody wanted him wakened; but peace—well, I tell ye,
boys, she was jest hell afloat. I’ve been fishing now a good many
years in Yankee spouters, and there’s some blood-boats among ’em,
but never was I so unlucky as when I first set foot aboard the
Salem. Skipper was a Portugee from Flores, come over to the States
as a nipper and brung up in Rhode Island. Don’t know and don’t
care how he got to be skipper, but I guess Jemmy Squarefoot was
his schoolmaster, for some of his tricks wouldn’t, couldn’t, have been
thought of anywheres else but down below. I ain’t a-goin’ to make
ye all miserable by telling you how he hazed us round and starved
us and tortured us, but you can let your imagination loose if you
want to, and then you won’t overhaul the facts of his daily
amusements.
“Well, I’d been with him about a year when, as I said at first, we
was cruising the Kingsmills, never going too close in, because at that
time the natives were very savage, always fighting with each other,
but very glad of the chance to go for a ship and kill and eat all
hands. Then again we had some Kanakas aboard, and the skipper
knew that if they got half a chance they would be overboard and off
to the shore.
“Sperm whales were very plentiful, in fact they had been so all the
cruise, which was another proof to all of us who the skipper was in
co. with, for in nearly every ship we gammed the crowd were heart-
broken at their bad luck. However, we’d only been a few days on the
ground when one morning we lowered for a thundering big school of
middling-size whales. We sailed in full butt, and all boats got fast.
But no sooner was a strain put on the lines than they all parted like
as if they was burnt. Nobody there ever seen or heard of such a
thing before. It fairly scared us all, for we thought it was witchcraft,
and some of ’em said the skipper’s time was up and his boss was
rounding on him. Well, we bent on again, second irons, as the
whales were all running anyhow, not trying to get away, and we all
got fast again. ’Twas no good at all; all parted just the same as
before. Well, we was about the worst gallied lot of men you ever
see. We was that close to the ship that we knew the old man could
see with his glasses everything that was going on. Every one of us
knew just about how he was bearing it, but what could we do? Well,
boys, we didn’t have much time to serlilerquise, for before you could
say ‘knife’ here he comes, jumping, howling mad. Right in among us
he busted, and oh! he did look like his old father Satan on the
rampage. He was in the bow of his boat, and he let drive at the first
whale he ran up against. Down went the fish and pop went the line
same as before. Well, I’ve seen folks get mad more’n a little, but
never in all my fishing did ever I see anything like he showed us
then. I thought he’d a sploded all into little pieces. He snatched off
his hat and tore it into ribbons with his teeth; the rattle of Portugee
blasphemion was like our old mincing-machine going full kelter, and
the foam flew from between his teeth like soapsuds.
“Suddenly he cooled down, all in a minute like, and said very
quiet, ‘All aboard.’ We were all pretty well prepared for the worst by
this time, but I do think we liked him less now than we did when he
was ramping around—he looked a sight more dangerous. However,
we obeyed orders smart, as usual, but he was aboard first. My! how
that boat of his just flew. ’Twas like a race for life.
“We were no sooner on board than we hoisted boats and made
them fast. Then the skipper yelled, ‘All hands lay aft.’ Aft we come
prompt, and ranged ourselves across the quarter-deck in front of
where he was prowling back and forth like a breeding tigress. As
soon as we were all aft he stopped, facing us, and spoke.
‘Somebody aboard this ship’s been trying to work a jolt off on me by
pisonin’ my lines. Now I want that man, so’s I can kill him, slow; ’n
I’m going to have him too ’thout waiting too long. Now I think this
ship’s been too easy a berth for all of you, but from this out until I
have my rights on the man I want she’s agoing to be a patent hell.
Make up yer mines quick, fer I tell yer no ship’s crew ever suffered
what you’re agoin’ to suffer till I get that man under my hands. Now
go.’
“When we got forrard we found the fo’c’s’le scuttle screwed up
so’s we couldn’t get below. There was no shelter on deck from the
blazing sun, the hatches was battened so we couldn’t get into the
fore-hold, so we had to just bear it. One man went aft to the scuttle
butt for a drink of water, and found the spigot gone. The skipper saw
him, and says to him, ‘You’ll fine plenty to drink in the bar’l forrard,’
and you know the sort of liquor that’s full of. Some of us flung
ourselves down on deck, being dog tired as well as hungry and
thirsty, but he was forrard in a minute with both his shooting-irons
cocked. ‘Up, ye spawn, ’n git some exercise; ye’r gettin’ too fat ’n
lazy,’ says he. So we trudged about praying that he might drop dead,
but none of us willing as yet to face certain death by defying him.
The blessed night came at last, and we were able to get a little rest,
he having gone below, and the officers, though willing enough to
keep in with him at our expense, not being bad enough to drive us
all night unless he was around to see it done. Along about eight bells
came the steward, with a biscuit apiece for us and a bucket of water
—about half a pint each. We were so starved and thirsty that the
bite and sup was a godsend. What made things worse for us was
the suspicion we had one of the other. As I said, we was, as usual, a
mixed crowd and ready to sell one another for a trifle. He knew that,
curse him, and reckoned with considerable certainty on getting hold
of the victim he wanted. Well, the night passed somehow, and when
morning came he was around again making us work, scouring iron-
work bright, holy-stoning decks, scrubbing overside, as if our very
lives depended on the jobs being done full pelt.
“We was drawing in pretty close to a small group of islands, closer
than we had been yet in those waters, and we all wondered what
was in the wind. Suddenly he gave orders to back the mainyard and
have the dinghy lowered. She was a tiny tub of a craft, such as I
never saw carried in a whaler before, only about big enough for
three. A little Scotchman and myself was ordered into her, then to
our amazement the old man got in, shoved off, and headed her for
the opening through the reef surrounding the biggest island of the
group. It was fairly well wooded with cocoa-nut trees and low
bushes, while, unlike any of the other islets, there were several big
rocks showing up through the vegetation in the middle of it. We
weren’t long getting to the beach, where we jumped out and ran her
up a piece so’s he could step out dry. We waited for a minute or two
while he sat thinking, and looking straight ahead of him at nothing.
Presently he jumped out and said to me, ‘Come,’ and to Sandy, ‘Stay
here.’ Off he went up the beach and straight into the little wood, just
as if somebody was calling him and he had to go. Apparently there
wasn’t a living soul on the whole island except just us three. We had
only got a few yards into the bush when we came to a little dip in
the ground: a sort of valley. Just as we got to the bottom, we
suddenly found ourselves in the grip of two Kanakas, the one that
had hold of the skipper being the biggest man I ever saw. I made
one wriggle, but my man, who was holding my two arms behind my
back, gave them a twist that nearly wrenched them out of their
sockets and quieted me good. As for the skipper, he was trying to
call or speak, but although his mouth worked no sound came, and
he looked like death. The giant that had him flung him on his face
and lashed his wrists behind him with a bit of native fish-line, then
served his ankles the same. I was tied next, but not so cruel as the
skipper, indeed they didn’t seem to want to hurt me. The two
Kanakas now had a sort of a consultation by signs, neither of them
speaking a word. While they was at it I noticed the big one was
horribly scarred all over his back and loins (they was both naked
except for a bit of a grass belt) as well as crippled in his gait.
Presently they ceased their dumb motions and came over to me.
The big one opened his mouth and pointed to where his tongue had
been, also to his right eye-socket, which was empty. Then he
touched the big white scars on his body, and finally pointed to the
skipper. Whole books couldn’t have explained his meaning better
than I understood it then. But what was coming? I declare I didn’t
feel glad a bit at the thought that Captain Ramirez was going to get
his deserts at last.
“Suddenly the giant histed the skipper on his shoulder as if he had
been a baby, and strode off across the valley towards the massive
heap of rocks, followed by his comrade and myself. We turned
sharply round a sort of gate, composed of three or four huge coral
blocks balanced upon each other, and entered a grotto or cave with
a descending floor. Over the pieces of rock with which the ground
was strewed we stumbled onward in the dim light until we entered
water and splashed on through it for some distance. Then, our eyes
being by this time used to the darkness, the general features of the
place could be made out. Communication with the sea was evident,
for the signs of high-water mark could be seen on the walls of the
cave just above our heads. For a minute or so we remained perfectly
still in the midst of that dead silence, so deep that I fancied I could
hear the shell-fish crawling on the bottom. Then I was brought a few
paces nearer the Captain, as he hung upon the great Kanaka’s
shoulder. Taking my eyes from his death-like face I cast them down,
and there, almost at my feet, was one of those enormous clams
such as you see the shells of thrown up on all these beaches, big as
a child’s bath. Hardly had the horrible truth dawned on me of what
was going to happen than it took place. Lifting the skipper into an
upright position, the giant dropped him feet first between the gaping
shells of the big clam, which, the moment it felt the touch, shut
them with a smash that must have broken the skipper’s legs. An
awful wail burst from him, the first sound he had yet made. I have
said he was brave, and he was, too, although such a cruel villain,
but now he broke down and begged hard for life. It may have been
that the Kanakas were deaf as well as dumb; at any rate, for all sign
of hearing they showed, they were. He appealed to me, but I was as
helpless as he, and my turn was apparently now to come. But
evidently the Kanakas were only carrying out what they considered
to be payment of a due debt, for after looking at him fixedly for
awhile, during which I felt the water rising round my knees, they
turned their backs on him and led me away. I was glad to go, for his
shrieks and prayers were awful to hear, and I couldn’t do anything.
“They led me to where they had first caught us, made me fast to
a tree, and left me. Overcome with fatigue and hunger I must have
fainted, for when I come to I found myself loose, lying on the sand,
and two or three of my shipmates attending to me. As soon as I was
able to speak they asked me what had become of the skipper. Then
it all rushed back on me at once, and I told them the dreadful story.
They heard me in utter silence, the mate saying at last, ‘Wall, sonny,
it’s a good job fer yew the Kanakers made ye fast, or yew’d have
had a job ter clear yersef of murder.’ And so I thought now.
However, as soon as I was a bit rested and had something to eat, I
led them to the cave, keeping a bright look-out meanwhile for a
possible attack by the Kanakas. None appeared though, and the tide
having fallen again we had no difficulty in finding the skipper. All that
was left of him, that is, for the sea-scavengers had been busy with
him, so that he was a sight to remember with a crawling at your
stomach till your dying day. He was still fast in the grip of the clam,
so it was decided to leave him there and get on board again at once.
“We did so unmolested, getting sail on the ship as soon as we
reached her, so as to lose sight of that infernal spot. But it’s no use
denying the fact that we all felt glad the skipper was dead; some
rejoiced at the manner of his death, although none could understand
who called him ashore or why he obeyed. Those who had whispered
the theory of the finish of his contract with Jemmy Squarefoot
chuckled at their prescience, as fully justified by the sequel,
declaring that the big Kanaka whom I had seen was none other than
Satan himself come for his bargain.
“Matters went on now in quite a different fashion. The relief was
so great that we hardly knew ourselves for the same men, and it
affected all hands alike, fore and aft. The secret of the breaking line
was discovered when Mr. Peck, the mate, took the skipper’s berth
over. In a locker beneath the bunk he found the pieces of a big
bottle, what they call a ‘carboy,’ I think, and in hunting up the why of
this a leakage through the deck was found into the store-room
where the cordage was kept. Only two other coils were affected by
the stuff that had run down, and of course they were useless, but
the rest of the stock was all right. Now, I don’t know what it was,
nor how it came there, nor any more about it, and if you ain’t tired
of listening I’m mighty tired of talking. Pass that ‘switchel’[1] this
way.”
[1]A drink of molasses, vinegar, and water.
M A R AT H O N O F T H E S E A L S
Far beyond the roaring track of the homeward-bound merchantman,
lie in the South Pacific the grim clusters of salt-whitened isles
marked on the chart as the South Shetlands. Many years have come
and gone since their hungry shores were busy with the labours of
the sealers, that, disdainful of the terrors of snow-laden gale and
spindrift-burdened air, toiled amid the Antarctic weather to fill their
holds with the garments of the sea-folk. Then, after perils incredible,
the adventurers would return to port, and waste in a week of
debauch the fruit of their toil, utterly forgetful of crashing floe or
hissing sea, frozen limbs or wrenching hunger pains. When all was
spent they would return, resolutely forgetting their folly and
wreaking upon the innocent seal all the rage of regret that would
rise within them. They spared none—bull, cow, and calf alike were
slain, as if in pure lust of slaughter, until the helplessness of utter
fatigue compelled them to desist and snatch an interval of death-like
sleep, oblivious of all the grinding bitterness of their surroundings.
Life was held cheap among them, a consequence, not to be
wondered at, of its hardness and the want of all those things that
make life desirable. And yet the stern existence had its own strong
fascination for those who had become inured to it. Few of them ever
gave it up voluntarily, ending their stormy life-struggle in some
sudden ghastly fashion and being almost immediately forgotten.
Occasionally some sorely-maimed man would survive the horrors of
his disablement, lying in the fetid forecastle in sullen endurance until
the vessel reached a port whence he could be transferred to
civilisation. But these unhappy men fretted grievously for the vast
openness of the Antarctic, the gnashing of the ice-fangs upon the
black rocks, the unsatisfied roar of the western gale, and the
ceaseless combat with the relentless sea.
Many years came and went while the Southern sealer plied his
trade, until at last none of the reckless skippers could longer
disguise from themselves the fact that their harvest fields were
rapidly becoming completely barren. Few and far between were the
islets frequented by the seals, the majority of the old grounds being
quite abandoned. One by one the dejected fishermen gave up the
attempt, until in due time those gaunt fastnesses resumed their
primitive loneliness. The long, long tempest roared questioningly
over the deserted islands, as if calling for its vanished children, and
refusing to be comforted because they were not. Years passed in
solitude, but for the busy sea-fowl, who, because they had no
commercial value, were left unmolested to eat their fill of the sea’s
rich harvest, and rear among the bleak rock-crannies their fluffy
broods. At last, out of the midst of a blinding smother of snow, there
appeared one day off the most southerly outlier of the South
Shetlands a little group of round velvety heads staring with wide,
humid eyes at the surf-lashed fortresses of the shore. Long and
warily they reconnoitred, for although many generations had passed
since their kind had been driven from those seas, the memory of
those pitiless days had been so steadily transmitted through the race
that it had become a part of themselves, an instinct infallible as any
other they possessed. No enemy appearing, they gradually drew
nearer and nearer, until their leader, a fine bull seal of four seasons,
took his courage in both flippers and mounted the most promising
slope, emerging from the foaming breakers majestically, and
immediately becoming a hirpling heap of clumsiness that apparently
bore no likeness to the graceful, agile creature of a few moments
before. Obediently his flock followed him until they reached a little
patch of hard smooth sand sheltered by a semi-circle of great wave-
worn boulders, and admirably suited to their purpose. Here, with
sleepless vigilance of sentinels, they rested, rather brokenly at first,
as every incursion of the indignant sea-fowl startled them, but
presently subsiding into ungainly attitudes of slumber.
Whence they had come was as great a mystery as all the deep-
water ways of the sea-people must ever be to man, or how many
halting-places they must have visited and rejected at the bidding of
their unerring instinct warning them that the arch-destroyers’ visits
were to be feared. However, they soon made themselves at home,
fattening marvellously upon the innumerable multitudes of fish that
swarmed around the bases of those barren islands, and between
whiles basking in the transient sun-gleams that occasionally touched
the desolate land with streaks of palest gold. And as time went on,
being unmolested in their domestic arrangements, the coming
generation tumbled about the rugged shore in those pretty gambols
that all young things love, learning steadily withal to take their
appointed places in the adult ranks as soon as they had proved their
capability so to do. Thus uneventfully and happily passed the
seasons until the little party of colonists had grown to be a goodly
herd, with leaders of mighty prowess, qualified to hold their own
against any of their kind, and inured to combat by their constantly
recurring battles with each other, their love affairs, in which they
fought with a fury astonishing to witness.
But one bright spring morning, when after a full meal the females
were all dozing peacefully among the boulders, and the pups were
gleefully waddling and tumbling among them, there came a message
from the sea to the fighting males, who instantly suspended their
family battles to attend to the urgent call. How the news came they
alone knew, its exact significance was hidden even from them, but a
sense of imminent danger was upon them all. The females called up
their young and retreated farther inland among the labyrinth of
rocky peaks that made the place almost impossible for human travel.
The males, about forty of them, ranged uneasily along the shore,
their wide nostrils dilated and their whiskers bristling with
apprehension. Ever and anon they would pause in their watchful
patrol and couch silently as if carved in marble, staring seaward with
unwinking eyes at the turbulent expanse of broken sea. Presently,
within a cable’s length of the shore, up rose an awful head—the
enemy had arrived. Another and another appeared until a whole
herd of several scores of sea-elephants were massed along the land
edge and beginning to climb ponderously over the jagged pinnacles
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.
ebookname.com