100% found this document useful (3 votes)
35 views

PDF Start Programming Using HTML CSS and JavaScript 1st Edition Iztok Fajfar (Author) download

CSS

Uploaded by

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

PDF Start Programming Using HTML CSS and JavaScript 1st Edition Iztok Fajfar (Author) download

CSS

Uploaded by

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

Download Full ebookname - Read Now at ebookname.

com

Start Programming Using HTML CSS and JavaScript


1st Edition Iztok Fajfar (Author)

https://ebookname.com/product/start-programming-using-html-
css-and-javascript-1st-edition-iztok-fajfar-author/

OR CLICK BUTTON

DOWLOAD EBOOK

Discover More Ebook - Explore Now at ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Security for Web Developers Using JavaScript HTML and CSS


Early Release Raw Unedited John Paul Mueller

https://ebookname.com/product/security-for-web-developers-using-
javascript-html-and-css-early-release-raw-unedited-john-paul-mueller/

ebookname.com

HTML CSS and JavaScript Mobile Development For Dummies 1st


Edition William Harrel

https://ebookname.com/product/html-css-and-javascript-mobile-
development-for-dummies-1st-edition-william-harrel/

ebookname.com

Building Android Apps with HTML CSS and JavaScript 2nd


Edition Jonathan Stark

https://ebookname.com/product/building-android-apps-with-html-css-and-
javascript-2nd-edition-jonathan-stark/

ebookname.com

Faulkner and Love The Women Who Shaped His Art 2009 1st
Edition Prof. Judith L. Sensibar

https://ebookname.com/product/faulkner-and-love-the-women-who-shaped-
his-art-2009-1st-edition-prof-judith-l-sensibar/

ebookname.com
The Future of Energy 1st Edition Brian F. Towler

https://ebookname.com/product/the-future-of-energy-1st-edition-brian-
f-towler/

ebookname.com

God s Day of Judgment The Real Cause of Global Warming 2nd


Edition Douglas B. Vogt

https://ebookname.com/product/god-s-day-of-judgment-the-real-cause-of-
global-warming-2nd-edition-douglas-b-vogt/

ebookname.com

Monitoring in Neurocritical Care 1st Edition Peter D. Le


Roux

https://ebookname.com/product/monitoring-in-neurocritical-care-1st-
edition-peter-d-le-roux/

ebookname.com

Land Law Text Cases and Materials 2nd Edition Ben


Mcfarlane

https://ebookname.com/product/land-law-text-cases-and-materials-2nd-
edition-ben-mcfarlane/

ebookname.com

Balanced Scorecard Step by Step Maximizing Performance and


Maintaining Results 2nd Edition Paul R. Niven

https://ebookname.com/product/balanced-scorecard-step-by-step-
maximizing-performance-and-maintaining-results-2nd-edition-paul-r-
niven/
ebookname.com
Evangellcals and Catholics in Nineteenth century Ireland
James H. Murphy (Editor)

https://ebookname.com/product/evangellcals-and-catholics-in-
nineteenth-century-ireland-james-h-murphy-editor/

ebookname.com
START
PROGRAMMING
using HTML, CSS,
and JAVASCRIPT
CHAPMAN & HALL/CRC
TEXTBOOKS IN COMPUTING

Series Editors

John Impagliazzo Andrew McGettrick


Professor Emeritus, Hofstra University Department of Computer
and Information Sciences
University of Strathclyde

Aims and Scope

This series covers traditional areas of computing, as well as related technical areas, such as
software engineering, artificial intelligence, computer engineering, information systems, and
information technology. The series will accommodate textbooks for undergraduate and gradu-
ate students, generally adhering to worldwide curriculum standards from professional societ-
ies. The editors wish to encourage new and imaginative ideas and proposals, and are keen to
help and encourage new authors. The editors welcome proposals that: provide groundbreaking
and imaginative perspectives on aspects of computing; present topics in a new and exciting
context; open up opportunities for emerging areas, such as multi-media, security, and mobile
systems; capture new developments and applications in emerging fields of computing; and
address topics that provide support for computing, such as mathematics, statistics, life and
physical sciences, and business.

Published Titles

Paul Anderson, Web 2.0 and Beyond: Principles and Technologies


Henrik Bærbak Christensen, Flexible, Reliable Software: Using Patterns and Agile Development
John S. Conery, Explorations in Computing: An Introduction to Computer Science
John S. Conery, Explorations in Computing: An Introduction to Computer Science and Python
Programming
Iztok Fajfar, Start Programming Using HTML, CSS, and JavaScript
Jessen Havill, Discovering Computer Science: Interdisciplinary Problems, Principles, and
Python Programming
Ted Herman, A Functional Start to Computing with Python
Pascal Hitzler, Markus Krötzsch, and Sebastian Rudolph, Foundations of Semantic Web
Technologies
Mark J. Johnson, A Concise Introduction to Data Structures using Java
Mark J. Johnson, A Concise Introduction to Programming in Python
Lisa C. Kaczmarczyk, Computers and Society: Computing for Good
Mark C. Lewis, Introduction to the Art of Programming Using Scala
Efrem G. Mallach, Information Systems: What Every Business Student Needs to Know
Bill Manaris and Andrew R. Brown, Making Music with Computers: Creative Programming in
Python
Uvais Qidwai and C.H. Chen, Digital Image Processing: An Algorithmic Approach with MATLAB®
David D. Riley and Kenny A. Hunt, Computational Thinking for the Modern Problem Solver
Henry M. Walker, The Tao of Computing, Second Edition
Chapman & Hall/CRC
TEXTBOOKS IN COMPUTING

START
PROGRAMMING
using HTML, CSS,
and JAVASCRIPT

Iztok Fajfar
University of Ljubljana
Slovenia
CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742
© 2016 by Taylor & Francis Group, LLC
CRC Press is an imprint of Taylor & Francis Group, an Informa business

No claim to original U.S. Government works


Version Date: 20150904

International Standard Book Number-13: 978-1-4987-3145-4 (eBook - PDF)

This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been
made to publish reliable data and information, but the author and publisher cannot assume responsibility for the valid-
ity of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright
holders of all material reproduced in this publication and apologize to copyright holders if permission to publish in this
form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may
rectify in any future reprint.

Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or uti-
lized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopy-
ing, microfilming, and recording, or in any information storage or retrieval system, without written permission from the
publishers.

For permission to photocopy or use material electronically from this work, please access www.copyright.com (http://
www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923,
978-750-8400. CCC is a not-for-profit organization that provides licenses and registration for a variety of users. For
organizations that have been granted a photocopy license by the CCC, a separate system of payment has been arranged.

Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for
identification and explanation without intent to infringe.
Visit the Taylor & Francis Web site at
http://www.taylorandfrancis.com
and the CRC Press Web site at
http://www.crcpress.com
To my family
Contents

Acknowledgments xi

Introduction xiii

About the Author xvii

1 Content and Structure 1


1.1 Opening . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Introducing HTML . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 The Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Minimal HTML Document . . . . . . . . . . . . . . . . . . . . . . . 4
1.5 Formatting a Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.6 Homework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2 Building a Sound Structure 15


2.1 Homework Discussion . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.2 Lists and Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.3 Generic <div> and <span> Elements . . . . . . . . . . . . . . . . . 21
2.4 Sectioning Elements . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.5 Hyperlinks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.6 Character Entities . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.7 Homework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

3 Presentation 35
3.1 Homework Discussion . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.2 Setting up a Web Server . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.3 Introducing CSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.4 CSS Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.5 CSS Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.6 CSS Pixel Unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.7 Homework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

4 More Control over Style 51


4.1 Homework Discussion . . . . . . . . . . . . . . . . . . . . . . . . . 51

vii
4.2 Class Selectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
4.3 ID Selectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
4.4 Grouping Selectors . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
4.5 Nesting Selectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
4.6 The HTML Ancestry Tree . . . . . . . . . . . . . . . . . . . . . . . 61
4.7 Inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
4.8 Determining Style Specificity . . . . . . . . . . . . . . . . . . . . . . 64
4.9 Relative Sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
4.10 Homework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

5 Understanding CSS Boxes 71


5.1 Homework Discussion . . . . . . . . . . . . . . . . . . . . . . . . . 71
5.2 CSS Box Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
5.3 Element Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
5.4 Positioning and Element Flow . . . . . . . . . . . . . . . . . . . . . 80
5.5 Containing Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
5.6 Hiding Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
5.7 Floated Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
5.8 Special Selectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
5.9 Homework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

6 Behavior 101
6.1 Homework Discussion . . . . . . . . . . . . . . . . . . . . . . . . . 101
6.2 Server Side Includes . . . . . . . . . . . . . . . . . . . . . . . . . . 104
6.3 Introducing JavaScript . . . . . . . . . . . . . . . . . . . . . . . . . 105
6.4 Values and Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
6.5 Operators and Expressions . . . . . . . . . . . . . . . . . . . . . . . 114
6.6 Concluding Remarks and Homework . . . . . . . . . . . . . . . . . . 124

7 Controlling Program Flow 127


7.1 Homework Discussion . . . . . . . . . . . . . . . . . . . . . . . . . 127
7.2 Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
7.3 Design a Simple Program . . . . . . . . . . . . . . . . . . . . . . . . 136
7.4 Type Conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
7.5 Homework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146

8 Introducing Objects 147


8.1 Homework Discussion . . . . . . . . . . . . . . . . . . . . . . . . . 147
8.2 switch Conditional . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
8.3 Math Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
8.4 do/while Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
8.5 Date Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
8.6 Concluding Thoughts and Homework . . . . . . . . . . . . . . . . . 164

9 Understanding Arrays and Strings 165


9.1 Homework Discussion . . . . . . . . . . . . . . . . . . . . . . . . . 165
9.2 Array Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
9.3 for Loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
9.4 Array Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178

viii Contents
9.5 String Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
9.6 Homework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185

10 Understanding Functions 187


10.1 Homework Discussion . . . . . . . . . . . . . . . . . . . . . . . . . 187
10.2 Writing Function Definitions . . . . . . . . . . . . . . . . . . . . . . 188
10.3 References to Function Objects . . . . . . . . . . . . . . . . . . . . . 195
10.4 Variable Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
10.5 Passing Function Arguments by Reference . . . . . . . . . . . . . . . 200
10.6 The Scope Chain and Closures . . . . . . . . . . . . . . . . . . . . . 201
10.7 Homework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204

11 Building Your Own Objects 205


11.1 Homework Discussion . . . . . . . . . . . . . . . . . . . . . . . . . 205
11.2 JavaScript Objects Revisited . . . . . . . . . . . . . . . . . . . . . . 207
11.3 Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
11.4 Constructor Overloading . . . . . . . . . . . . . . . . . . . . . . . . 211
11.5 Factory Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
11.6 The prototype Object . . . . . . . . . . . . . . . . . . . . . . . . . 214
11.7 More on Setting and Querying Object Properties . . . . . . . . . . . . 217
11.8 Sudoku Puzzle Helper . . . . . . . . . . . . . . . . . . . . . . . . . . 219
11.9 Homework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225

12 Using JavaScript to Control the Browser 227


12.1 Homework Discussion . . . . . . . . . . . . . . . . . . . . . . . . . 227
12.2 Deeper into the Browser . . . . . . . . . . . . . . . . . . . . . . . . 229
12.3 Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230
12.4 Scripting Documents . . . . . . . . . . . . . . . . . . . . . . . . . . 233
12.5 Timer Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
12.6 Scripting Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
12.7 Introducing Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
12.8 Homework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243

13 User Interface 245


13.1 Homework Discussion . . . . . . . . . . . . . . . . . . . . . . . . . 245
13.2 Using Family Relations to Manipulate Elements . . . . . . . . . . . . 247
13.3 Completing Math Worksheet Generator . . . . . . . . . . . . . . . . 249
13.4 Completing Sudoku Puzzle Helper . . . . . . . . . . . . . . . . . . . 255
13.5 Homework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262

A Solution to the Last Homework: Sudoku Generator 265

B Ways to Continue 271


B.1 Graphics with Canvas . . . . . . . . . . . . . . . . . . . . . . . . . . 271
B.2 Local Data Storage through Web Storage . . . . . . . . . . . . . . . . 279
B.3 Ajax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
B.4 jQuery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
B.5 Go Mobile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302

Contents ix
C HTML Mini Reference 305
C.1 Root Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
C.2 Document Metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
C.3 Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
C.4 Sections and Structure . . . . . . . . . . . . . . . . . . . . . . . . . 311
C.5 Grouping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
C.6 Text-Level Semantics . . . . . . . . . . . . . . . . . . . . . . . . . . 321
C.7 Embedded Content . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
C.8 Tabular Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
C.9 Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
C.10 Global Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
C.11 Event-Handler Attributes . . . . . . . . . . . . . . . . . . . . . . . . 338

D CSS Mini Reference 339


D.1 CSS Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
D.2 inherit keyword . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
D.3 Text Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
D.4 List Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
D.5 Borders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
D.6 Spacing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
D.7 Background Properties . . . . . . . . . . . . . . . . . . . . . . . . . 357
D.8 Table Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
D.9 Size Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
D.10 Positioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
D.11 Pseudo-Classes and Pseudo-Elements . . . . . . . . . . . . . . . . . 367

E JavaScript Mini Reference 373


E.1 Operator Precedence and Associativity . . . . . . . . . . . . . . . . . 373
E.2 arguments[] (Core JavaScript) . . . . . . . . . . . . . . . . . . . . 374
E.3 Array (Core JavaScript) . . . . . . . . . . . . . . . . . . . . . . . . . 374
E.4 Boolean (Core JavaScript) . . . . . . . . . . . . . . . . . . . . . . . 379
E.5 console (Client-Side JavaScript) . . . . . . . . . . . . . . . . . . . 380
E.6 Date (Core JavaScript) . . . . . . . . . . . . . . . . . . . . . . . . . 383
E.7 document (Client-Side JavaScript) . . . . . . . . . . . . . . . . . . . 391
E.8 Element (Client-Side JavaScript) . . . . . . . . . . . . . . . . . . . . 396
E.9 Event (Client-Side JavaScript) . . . . . . . . . . . . . . . . . . . . . 402
E.10 Function (Core JavaScript) . . . . . . . . . . . . . . . . . . . . . . . 405
E.11 Global Variables, Functions, and Objects (Core JavaScript) . . . . . . 406
E.12 Math (Core JavaScript) . . . . . . . . . . . . . . . . . . . . . . . . . 409
E.13 Node (Client-Side JavaScript) . . . . . . . . . . . . . . . . . . . . . 414
E.14 Number (Core JavaScript) . . . . . . . . . . . . . . . . . . . . . . . 416
E.15 Object (Core JavaScript) . . . . . . . . . . . . . . . . . . . . . . . . 420
E.16 String (Core JavaScript) . . . . . . . . . . . . . . . . . . . . . . . . . 421
E.17 window (Client-Side JavaScript) . . . . . . . . . . . . . . . . . . . . 427

x Contents
Acknowledgments

A huge thank you goes to the guys at Taylor and Francis, especially to my editor Randi
Cohen for her enthusiasm for the whole project, my project coordinator Ashley We-
instein, who oversaw production attentively, and technical reviewers for their detailed
comments making the whole book more enjoyable. Many thanks also to the proof-
reader for correcting typos and grammar. Indeed, it was a great pleasure to work with
such a professional team.

Honestly, all this wouldn’t have happened were it not for Igor and the other guys from
the morning-coffee crew, who suggested that I should really write a book. Thanks,
chaps, it cost me a year of my life. Thank you to all my amazing students for sitting
through my programming lectures and asking nasty questions. Man, how should I
know all that? I shall not forget to also thank the other teaching staff from the team.
The joy of working together is immeasurable. I’m deeply indebted to Žiga, who had
painstakingly read the whole manuscript before releasing it to the wild. (I sincerely
hope you spotted all the silly mistakes so I don’t make a fool of myself.) Thank you,
Andrej, for technical advice on preparing the camera-ready PDF. Those are really
details that make a difference. A thousand thanks go to Tanja and Tadej for that little
push that did the trick. You are terrific!

I also wish to extend my considerable gratitude to everyone that gave away their pre-
cious time, energy, and invaluable expertise answering questions on forums, posting
on blogs, and writing all those wonderful LATEXpackages. It’s impossible to list you
all by name because I’m contracted for only 400 or so pages.

A colossal thank you goes out to my mom and dad for instantiating and personalizing
me. It wasn’t the easiest assignment in the world but you did a marvelous job! Many
thanks to my second parents, Dana and Ivo, for telling me that I should also eat if I am
ever to finish the book. A zillion thanks go out to my close family. Thank you, Erik, for
patiently checking which page I am on with an I-want-my-daddy-back determination;
and thank you, Monika, for tons of understanding and supportive coffee mugs. I love
you!

I am also thankful for the support of the Ministry of Education, Science, and Sport of
the Republic of Slovenia within the research program P2-0246—Algorithms and Opti-

xi
mization Methods in Telecommunications, which made possible some of the research
for this book.

And, of course, thank you, the reader. Without you, this book wouldn’t make much
sense, would it?

—Iztok Fajfar (iztok.fajfar.eu), March 2015

xii Acknowledgments
Introduction

Easy to Use
Normally, putting honey in my tea is not a particularly demanding task, but that morn-
ing my hand was paralyzed in astonishment, trying to do its routine job of pouring
some honey in the steaming cup. Honey labels usually say things like “All Natural,”
“Contains Antioxidants,” or “With Grandma’s Recipe Book.” Over time, I’ve got used
to more absurd labels like “Improved New Flavor” or “Gathered by Real Bees.” The
label that knocked me out was surprisingly plain, with an award-winning message
printed on it: “Easy to Use.” I don’t recall honey ever being hard to use, except maybe
when it crystallizes, or when I was six months old, but that’s probably not exactly
what the author of the message had in mind.

You can also buy programming books that promise easy and quick learning, even as
fast as in 24 hours. An average adult can read a novel in 24 hours. But let’s face it, no
one can read—let alone understand and learn—a 500-page technical book in 24 hours.
While using honey is not difficult even when it doesn’t explicitly say so, learning to
program is not easy. It can be fun if you’re motivated and have decent material to
study from, but it’s also an effort. If you’re not ready to accept that, then this book
is not for you. Otherwise, I invite you to join Maria, Mike, and me at exploring the
exciting world of computer programming. It’s going to be fun but it’s also going to be
some work.

About the Book


This handbook is a manual for undergraduate students of engineering and natural
science fields written in the form of a dialog between two students and a professor
discovering how computer programming works. It is organized in 13 thematic meet-
ings with explanations and discussions, supported by gradual evolution of engaging
working examples of live web documents and applications using HTML, CSS, and
JavaScript. You will see how the three mainstream languages interact, and learn some
of the essential practices of using them to your advantage. At the end of each meeting
there is a practical homework, which is always discussed at the beginning of the next
meeting. There is also a list of related keywords to help you review important topics

xiii
of each meeting.

The general structure of the book is multilayered: the basic language syntax and rules
are fleshed out with contents and structure while still keeping things simple and man-
ageable, something that many introductory textbooks lack.

The main body of the text is accompanied by five appendices. The first of them con-
tains a solution of the last homework, the second summarizes (also with examples)
some major directions in which you can continue your study, including hints on some
of the relevant sources. The last three appendices are abbreviated references of the
three languages used in the book.

There will be situations when you need to use yet more languages and technologies in
order to get the job done. Some such situations are gently dealt with in this book. For
example, you will learn just enough about a Server Side Includes language to be able
to include external HTML code, which will save you a tremendous amount of time
and energy.

Is This Book for Me?


If you know absolutely nothing about computer programming and want to learn, this
is the book for you. It has been written with a complete beginner in mind in the first
place.

If you have been exposed to programming before, you might find the book useful
as well. Today, many people learn from examples and forums, and thus acquired
knowledge is mostly skills and not much theory. If you ever want to build more
serious software, you need a firm and systematic understanding of what is going on.
You need a framework to which you can systematically attach your partial skills to
form a sound structure of connected knowledge. Hopefully, this book can give you
this as well.

Last but not least, if you’re a teacher of an introductory programming course, you
might find a handful of useful examples and approaches for your classes on the few
hundred pages that follow.

But most likely, as there are as many learning styles as there are learners, you will
have to find out for yourself whether or not this book is for you.

How to Avoid Reading the Whole Book


Don’t panic! If you are only up to JavaScript programming, you can just read Meeting
1 to get a basic idea of what HTML is (you need this in order to be able to run the
JavaScript examples in this book), and then you can immediately skip to Meeting
6—more specifically, Section 6.3. There are some examples involving CSS in the
JavaScript part but they won’t stand in the way of your learning JavaScript. Later, if
you feel like it, you can just as well skim over Meeting 3, where you can get the basic
idea of what CSS is all about.

xiv Introduction
For Your Safety
This book is not about cutting-edge web technologies, so you don’t need any pro-
tective equipment. It is more about general computer programming and some web-
related principles using the mainstream web languages HTML, CSS, and JavaScript
as examples. Some of the principles are over 40 years old, but are extremely important
because they allow you to write cleaner and more easily maintainable code, and they
will not go away just like that.

It’s a busy world, and the sixth edition of ECMAScript standard (the standardized
version of JavaScript) has just entered the official publication process. The good news
is that it only introduces additions to its predecessor, so the essential concepts stay.
Also, while CSS3 isn’t completely finished yet, there already exist some so-called
“level 4” CSS modules. Fortunately, they are also just additions to the CSS standard
and there are no serious plans for a single CSS4 specification on the horizon. This
book pays attention to the basic concepts that have matured with the latest HTML5,
CSS3, and ECMAScript 5 standards to the point where it seems these concepts are
going to persist for some time.

The Software Used


In researching this book, I used Google Chrome and Notepad++ v6.5.3 (notepad-plus-
plus.org ) on a Windows 7 Professional SP1 64bit operating system. I also used the
EasyPHP DevServer 13.1 VC11 web development server (www.easyphp.org ). How-
ever, you will be able to follow most of the examples and experiments in this book
using any modern browser and plain text editor. They are already installed on your
computer, so you can start experimenting right away.

Conventions Used in This Book


The following typographical conventions are used in this book:

A monospaced font is used for all code listings and everything that you normally
type on a keyboard, including keys and key combinations.

A monospaced italic font is used as a general placeholder to mark items that


you should replace with an actual value or expression in your code.

An italic font is used to indicate the first appearance of a term, or as an emphasis.

A sans serif font is used to indicate a menu item.

A sans serif italic font is used to indicate URLs and file names and extensions.

Feedback and Supporting Online Material


I deeply appreciate having any comments, suggestions, or errors found brought to my
attention at the email address [email protected]. You will find source code
of the examples in this book and some additional materials and problems for each
chapter at fajfar.eu/start-programming.

Introduction xv
About the Author

Iztok Fajfar got his first computer in the early 1980s, a ZX Spectrum with an amaz-
ing 48 KB of RAM. Computers soon turned into a lifelong fascination and an indis-
pensable companion, assisting him in his professional work and hobbies alike. Iztok
has a PhD degree in electrical engineering from the University of Ljubljana, Slovenia,
where he is currently Associate Professor at the Faculty of Electrical Engineering. His
research topics include evolutionary algorithms, in particular, genetic programming.
He teaches computer programming at all levels, from assembly to object-oriented, and
to all kinds of audience. Now and then he even ventures to explain to his mother-in-
law how to forward an email, and he hasn’t given up yet. He is also a programmer
and writer. Iztok lives with his family in Ljubljana, and when he is not programming,
or teaching, or researching weird stuff, he makes the most yummy pancakes, not to
mention the pizza.

xvii
Meeting 1
Content and Structure

1.1 Opening
Professor: I’m thrilled that you accepted my invitation to help me with a new book
I am researching. There are three languages awaiting us in this course: HTML, CSS,
and JavaScript.

Mike: Why three? You’ll just confuse us, won’t you?

Professor: The languages have been designed for quite specific purposes and work
very differently, so there is little danger in confusing them. At the same time, the three
languages nicely complement each other: HTML holds the structure and content of a
web page, CSS takes care of presentation, and JavaScript is responsible for action. I
like to say that HTML is bones, CSS is flesh, and JavaScript is the brain and muscles
of web programming.

Maria: How much of a chance is there of us learning three languages to the level that
we can use any of them to our advantage?

Professor: You don’t have to be a guru in any of them to start using them effectively.
It’s only important that you know the basic principles. The good news is you don’t
have to install or learn to use any new software. All you need to start off is already
installed on your computer.

Do you have any programming experience?

Maria: Actually, I use a computer a lot but not for programming. I have never written
a computer program before.

Mike: Neither have I.

Professor: In a way, programming is like speaking. You speak English, right?

Mike: Yes...?

Professor: I even know people who have learned Finnish. Quite well, to be honest.

1
English and Finnish are examples of natural languages, which people learn to com-
municate with other people. However, if you want to talk to computers, you have to
learn artificial languages so that computers understand and obey you. It’s very similar.
The only difference is that people won’t obey you if you lack charm, while computers
won’t obey you if you’re not accurate. Accuracy is crucial. Similar to both is that it
takes a certain amount of practice before your interlocutor understands you. I won’t
lie to you on this one.

Maria: I’m just starting to learn Spanish and I must use a sign language a lot. I
suppose you cannot use a sign language with a computer.

Professor: That’s true. In natural languages, people use context and even a sign
language to guess what others have to say even though what they say may not be
grammatically correct. Computers don’t do that, though, and that’s the difficult part
of programming. You have to be exact.

All right. Let’s start programming, shall we?

1.2 Introducing HTML


Professor: To be precise, HTML is not a programming language but it is a so-called
markup language. That’s what the acronym HTML stands for: Hypertext Markup
Language. Markup is a modern approach for adding different annotations to a docu-
ment in such a way that these annotations are distinguishable from plain text. Markup
instructions tell the program that displays your text what actions to perform while the
instructions themselves are hidden from the person that views your text. For example,
if you want a certain part of your text to appear as a paragraph, you simply mark up
this part of the text using appropriate tags:

<p>But it’s my only line!</p>

Maria: It looks quite straightforward. Are those p’s in the angle brackets like com-
mands?

Professor: You could say that. They are called tags and they instruct or command a
browser to make a paragraph out of the text between them.

Mike: That’s like formatting, isn’t it?

Professor: In a way, yes. Tags are like commands in a word processor that allow
you to format paragraphs, headings, and so forth. However, they only specify what to
format, not how to do it.

The above code fragment is an example of an HTML element—the basic building


block of an HTML document. An HTML document is composed exclusively of ele-
ments. Each element is further composed of a start tag and end tag, and everything in
between is the content:

2 Meeting 1. Content and Structure


Start Tag Content End Tag
<p> But it’s my only line! </p>

The start tag is also called the opening tag while the end tag is also called the closing
tag. By the way, the name, or the abbreviation of the name of the element is written
inside the tags. In particular, p stands for a paragraph. The closing tag should have an
additional slash (/) before the element’s name.

In order for a paragraph to show in the browser, we need to add two more things to
get what is generally considered the minimum HTML document. The first line should
be a special declaration called DOCTYPE, which makes a clear announcement that
HTML5 content follows. The DOCTYPE declaration is written within angle brack-
ets with a preceding exclamation mark and the html keyword after it: <!DOCTYPE
html>. Although it looks like a tag, this is actually the only part of an HTML docu-
ment that isn’t a tag or an element. As a matter of fact, this code is here for historical
reasons. I don’t want to kill you with details, but you have to include it if you want
your document to be interpreted by the browser correctly.

One more thing that the minimum document should contain is a <title> element.
This element is necessary as it identifies the document even when it appears out of
context, say as a user’s bookmark or in search results. The document should contain
no more than one <title> element.

Putting it all together, we get the following code:


<!DOCTYPE html>
<title>The Smallest HTML Document</title>
<p>But it’s my only line!</p>

Maria: You just showed us what the document code should look like. But I still don’t
know where to type the code and how to view the resulting page.

1.3 The Tools


Professor: You can use any plain text editor you like. For example, you can use the
Windows Notepad, which is already on your computer if you use Windows.

Mike: What if I don’t use Windows?

Professor: It doesn’t matter. Just about any operating systems contains a plain text
editor. Personally, I use Notepad++, a programmer-friendly free text editor (notepad-
plus-plus.org ).

After you type the code, it is important that you save the file with a .htm or .html
extension. While it doesn’t really matter which one you use, it is quite important that
you choose one and stick to it consistently. Otherwise, you could throw yourself into
a real mess. For example, you could easily end up editing two different files (same
names, different extensions) thinking they’re one and the same file.

1.3. The Tools 3


Now we open the file in a browser and voilà!

Notice how the content of the <title> element appears at the top of the browser tag.

Mike: How did you open the file in the browser?

Professor: Oh yes, sorry about that. Inside Notepad++, I chose Run→Launch in


Chrome. If you use another browser, it will automatically appear under the Run menu
item in your Notepad++. You can of course also simply double-click the file or drag
and drop it into the browser. Once the file is open in the browser, you don’t have to
repeat this operation. If you modify the source code—the original HTML code, that
is—you simply refresh the browser window. If you use Chrome like I do, you can do
that by pressing F5. Later, you will use more than a single file to build a page. In that
case, you will sometimes have to force reload all files of a page, which you can do
by pressing Ctrl+F5 on Chrome. On Windows, to switch between the text editor and
browser quickly, you press Alt+Tab, a standard key combination for switching between
running tasks.

Maria: What would happen if we forgot to include the <title> element?

Professor: Nothing fatal, to be honest. One of the basic rules of rendering web pages
is that the browser always tries its best to show the content. Of course, if the document
isn’t fully formatted according to the recommendations, the results are sometimes not
in our favor. If you forget the title, then the name of the file containing the document
usually takes over its role. If nothing else, that looks ugly and unprofessional.

1.4 Minimal HTML Document


Professor: One of the general prerequisites to good technical design is simplicity,
which should not be confused with minimalism. In our last example, we saw a truly
minimal HTML document, which you will rarely see in practice. Even with no extra
content it is normally a good idea to flesh out this skeleton HTML document. For in-
stance, most web developers share the belief that the traditional <head> and <body>
elements can contribute to clarity, by cleanly separating your document into two sec-
tions. You pack all the content into the <body> section, while the other information
about your page goes to the <head> section. Sometimes it is also a good idea to wrap
both these sections in the traditional <html> element:
<!DOCTYPE html>
<html>
<head>
<title>The Smallest HTML Document</title>
</head>

4 Meeting 1. Content and Structure


<body>
<p>But it’s my only line!</p>
</body>
</html>

Mike: I noticed that an element can contain not only text but another element as well.
For example, you placed the <title> element within the <head> element.

Professor: Good observation! The content of an element can in fact be any valid
HTML conforming to the rules of that specific element. We call putting one element
into another nesting. When an element is nested (contains other HTML elements), it
is important that it contains whole elements, including start and end tags. So if, for
example, an <elementA > starts before an <elementB >, then it must by all means
end after the <elementB >:

<elementA > ... <elementB > ... </elementB > ... </elementA >

The element that is contained inside another element inherits some of its behavior,
and we often say that the contained element is a descendant of its owner, which is in
turn its parent. The direct descendant is also called a child. This concept will become
especially important when we come to styling elements with CSS. Now I only mention
it so that later the terms will already sound familiar to you.

Maria: What are those periods inside?

Professor: Oh, yes. A set of three periods is an ellipsis. An ellipsis indicates the
omission of content that is not important for understanding the explanation.

We will soon come back to our last example and furnish it with a little more. For
that purpose we need another element called <meta>. This element is used to pro-
vide additional page description (so-called metadata), which is not displayed on the
page, but can be read by a machine. The information stored in the <meta> element
includes keywords, author of the document, character encoding, and other metadata.
The <meta> element has neither content nor the closing tag:

<meta>

An element that is composed only of the opening tag is called an empty or void ele-
ment.

Mike: I don’t understand that. Where do you put all the information you talked about
if there is no content?

Professor: That’s the job for attributes. An attribute is the means of providing addi-
tional information about an HTML element. For example, by using the src attribute
on the <img> element, one can tell the browser where to find the image to display.
There are two things you should know about attributes: they are always specified after
the element name in the start tag, and they come in name/value pairs like this one:

1.4. Minimal HTML Document 5


Exploring the Variety of Random
Documents with Different Content
“What can we do to help our country?” asked Tony Vassall of his
master, “we have no money to lend.”
“No?” was the reply. “But you can give your strong son Dan.”
Tony gave his son Dan to the country.
“Good-bye, dear son,” said his father, and his brother and his
sister Nancy said “Good-bye.” His mother kissed him.
Dan was killed in battle; his sister Nancy took his place at the mill.
In a little while the neighbours said to Tony Vassall: “What a fine
strong son is your young Albert Edward!”
And Tony gave his son Albert Edward to the country.
“Good-bye, dear son,” said his father; his sister kissed him, his
mother wept on his breast.
Albert Edward was killed in battle; his mother took his place at the
mill.
But the war did not cease; though friend and foe alike were
almost drowned in blood it seemed as powerful as eternity, and in
time Tony Vassall too went to battle and was killed. The country
gave Patience a widow’s pension, as well as a touching inducement
to marry again; she died of grief. Many people died in those days, it
was not strange at all. Nathan and his wife got so rich that after the
war they died of over-eating, and their daughter Olive came into a
vast fortune and a Trustee.
The Trustee went on lending the Braddle money to the country,
the country went on sending large sums of interest to Olive (which
was the country’s tribute to her because of her parents’ unforgotten,
and indeed unforgettable, kindness), while Braddle went on with its
work of enabling the country to do this. For when the war came to
an end the country told Braddle that those who had not given their
lives must now turn to and really work, work harder than before the
war, much, much harder, or the tribute could not be paid and the
heart of Braddle would therefore cease to beat. Braddle folk saw
that this was true, only too true, and they did as they were told.
The Vassall girl, Nancy, married a man who had done deeds of
valour in the war. He was a mill hand like her father, and they had
two sons, Daniel and Albert Edward. Olive married a grand man,
though it is true he was not very grand to look at. He had a small
sharp nose, but they did not matter very much because when you
looked at him in profile his bouncing red cheeks quite hid the small
sharp nose, as completely as two hills hide a little barn in a valley.
Olive lived in a grand mansion with numerous servants who helped
her to rear a little family of one, a girl named Mercy, who also had a
small sharp nose and round red cheeks.
Every year after the survivors’ return from the war Olive gave a
supper to her workpeople and their families, hundreds of them; for
six hours there would be feasting and toys, music and dancing.
Every year Olive would make a little speech to them all, reminding
them all of their duty to Braddle and Braddle’s duty to the country,
although, indeed, she did not remind them of the country’s tribute to
Olive. That was perhaps a theme unfitting to touch upon, it would
have been boastful and quite unbecoming.
“These are grave times for our country,” Olive would declare, year
after year: “her responsibilities are enormous, we must all put our
shoulders to the wheel.”
Every year one of the workmen would make a little speech in
reply, thanking Olive for enabling the heart of Braddle to continue its
beats, calling down the spiritual blessings of heaven and the golden
blessings of the world upon Olive’s golden head. One year the
honour of replying fell to the husband of Nancy, and he was more
than usually eloquent for on that very day their two sons had
commenced to doff bobbins at the mill. No one applauded louder
than Nancy’s little Dan or Nancy’s Albert Edward, unless it was
Nancy herself. Olive was always much moved on these occasions.
She felt that she did not really know these people, that she would
never know them; she wanted to go on seeing them, being with
them, and living with rapture in their workaday world. But she did
not do this.
“How beautiful it all is!” she would sigh to her daughter, Mercy,
who accompanied her. “I am so happy. All these dear people are
being cared for by us, just simply us. God’s scheme of creation—you
see—the Almighty—we are his agents—we must always remember
that. It goes on for years, years upon years it goes on. It will go on,
of course, yes, for ever; the heart of Braddle will not cease to beat.
The old ones die, the young grow old, the children mature and
marry and keep the mill going. When I am dead ...”
“Mamma, mamma!”
“O yes, indeed, one day! Then you will have to look after all these
things, Mercy, and you will talk to them—just like me. Yes, to own
the mill is a grave and difficult thing, only those who own them
know how grave and difficult; it calls forth all one’s deepest and
rarest qualities; but it is a divine position, a noble responsibility. And
the people really love me—I think.”
The Handsome Lady
Towards the close of the nineteenth century the parish of Tull was
a genial but angular hamlet hung out on the north side of a midland
hill, with scarcely renown enough to get itself marked on a map. Its
felicities, whatever they might be, lay some miles distant from a
railway station, and so were seldom regarded, being neither boasted
of by the inhabitants nor visited by strangers.
But here as elsewhere people were born and, as unusual,
unconspicuously born. John Pettigrove made a note of them then,
and when people came in their turns to die Pettigrove made a note
of that too, for he was the district registrar. In between whiles, like
fish in a pond, they were immersed in labour until the Divine Angler
hooked them to the bank, and then, as is the custom, they were
conspicuously buried and laboured presumably no more.
The registrar was perhaps the one person who had love and
praise for the simple place. He was born and bred in Tull, he had
never left Tull, and at forty years of age was as firmly attached to it
as the black clock to the tower of Tull Church, which never recorded
anything but twenty minutes past four. His wife Carrie, a delicate
woman, was also satisfied with Tull, but as she owned two or three
small pieces of house property there her fancy may not have been
entirely beyond suspicion; possession, as you might say, being nine
points of the prejudice just as it is of the law. A year or two after
their marriage Carrie began to suffer from a complication of ailments
that turned her into a permanent invalid; she was seldom seen out
of the house and under her misfortunes she peaked and pined, she
was troublesome, there was no pleasing her. If Pettigrove went
about unshaven she was vexed; it was unclean, it was lazy,
disgusting; but when he once appeared with his moustache shaven
off she was exceedingly angry; it was scandalous, it was shameful,
maddening. There is no pleasing some women—what is a man to
do? When he began to let it grow again and encouraged a beard she
was more tyrannical than ever.
The grey church was small and looked shrunken, as if it had
sagged; it seemed to stoop down upon the green yard, but the
stones and mounds, the cypress and holly, the strangely faded blue
of a door that led through the churchyard wall to the mansion of the
vicar, were beautiful without pretence, and though as often as not
the parson’s goats used to graze among the graves and had been
known to follow him into the nave, there was about the ground, the
indulgent dimness under the trees, and the tower with its unmoving
clock, the very delicacy of solitude. It inspired compassion and not
cynicism as, peering as it were through the glass of antiquity, the
stranger gazed upon its mortal register. In its peace, its beauty, and
its age, all those pious records and hopes inscribed upon its stones,
seemed not uttered in pride nor all in vain. But to speak truth the
church’s grace was partly the achievement of its lofty situation. A
road climbing up from sloping fields turned abruptly and traversed
the village, sidling up to the church; there, having apparently
satisfied some itch of curiosity, it turned abruptly again and trundled
back another way into that northern prospect of farms and forest
that lay in the direction of Whitewater Copse, Hangman’s Corner,
and One O’clock.
It was that prospect which most delighted Pettigrove, for he was a
simple-minded countryman full of ambling content. Not even the
church allured him so much, for though it pleased him and was just
at his own threshold, he never entered it at all. Once upon a time
there had been talk of him joining the church choir, for he had a
pleasant singing voice, but he would not go.
“It’s flying in the face of Providence,” cried his exasperated wife—
her mind, too, was a falsetto one: “You’ve as strong a voice as
anyone in Tull, in fact stronger, not that that is saying much, for Tull
air don’t seem good for songsters if you may judge by that choir.
The air is too thick maybe, I can’t say, it certainly oppresses my own
chest, or perhaps it’s too thin, I don’t thrive on it myself; but you’ve
the strength and it would do you credit; you’d be a credit to yourself
and it would be a credit to me. But that won’t move you! I can’t tell
what you’d be at; a drunken man ’ull get sober again, but a fool ...
well, there!”
John, unwilling to be a credit, would mumble an objection to being
tied down to that sort of thing. That was just like him, no
spontaneity, no tidiness in his mind. Whenever he addressed himself
to any discussion he had, as you might say, to tuck up his
intellectual sleeves, give a hitch to his argumentative trousers. So he
went on singing, just when he had a mind to it, old country songs,
for he disliked what he called “gimcrack ballads about buzzums and
roses.”
Pettigrove’s occupation dealt with the extreme features of
existence, but he himself had no extreme notions. He was a good
medium type of man mentally and something more than that
physically, but nevertheless he was a disappointment to his wife—he
never gave her any opportunity to shine by his reflected light. She
had nurtured foolish ideas of him first as a figure of romance, then
of some social importance; he ought to be a parish councillor or
develop eminence somehow in their way of life. But John was
nothing like this, he did not develop, or shine, or offer counsel, he
was just a big, solid, happy man. There were times when his
childless wife hated every ounce and sign of him, when his fair
clipped beard and hair, which she declared were the colour of jute,
and his stolidity, sickened her.
“I do my duty by him and, please God, I’ll continue to do it. I’m a
humble woman and easily satisfied. An afflicted woman has no
chance, no chance at all,” she said. After twelve years of wedded life
Pettigrove sometimes vaguely wondered what it would have been
like not to have married anybody.
One Michaelmas a small house belonging to Mrs. Pettigrove was
let to a widow from Eastbourne. Mrs. Cronshaw was a fine
upstanding woman, gracefully grave and, as the neighbours said,
clean as a pink. For several evenings after she had taken possession
of the house Pettigrove, who was a very handy sort of man, worked
upon some alterations to her garden, and at the end of the third or
fourth evening she had invited him into her bower to sip a glass of
some cordial, and she thanked him for his labours.
“Not at all, Mrs. Cronshaw.” And he drank to her very good
fortune. Just that and no more.
The next evening she did the same, and the very next evening to
that again. And so it was not long before they spoke of themselves
to each other, turn and turn about as you might say. She was the
widow of an ironmonger who had died two years before, and the
ironmonger’s very astute brother had given her an annuity in
exchange for her interest in the business. Without family and with
few friends she had been lonely.
“But Tull is such a hearty place,” she said. “It’s beautiful. One
might forget to be lonely.”
“Be sure of that,” commented Pettigrove. They had the light of
two candles and a blazing fire. She grew kind and more
communicative to him; a strangely, disturbingly attractive woman,
dark, with an abundance of well-dressed hair and a figure of charm.
She had carpet all over her floor; nobody else in Tull dreamed of
such a thing. She did not cover her old dark table with a cloth as
everybody else habitually did. The pictures on the wall were real,
and the black-lined sofa had cushions on it of violet silk which she
sometimes actually sat upon. There was a dainty dresser with china
and things, a bureau, and a tall clock that told the exact time. But
there was no music, music made her melancholy. In Pettigrove’s
home there were things like these but they were not the same. His
bureau was jammed in a corner with flowerpots upon its top; his
pictures comprised two photo prints of a public park in Swansea—his
wife had bought them at an auction sale. Their dresser was a
cumbersome thing with knobs and hooks and jars and bottles, and
the tall clock never chimed the hours. The very armchairs at Mrs.
Cronshaw’s were wells of such solid comfort that it made him feel
uncomfortable to use them.
“Ah, I should like to be sure of it!” she continued. “I have not
found kindly people in the cities—they do not even seem to notice a
fine day!—I have not found them anywhere, so why should they be
in Tull? You are a wise man, tell me, is Tull the exception?”
“Yes, Mrs. Cronshaw. You must come and visit us whenever you’ve
a mind to; have no fear of loneliness.”
“Yes, I will come and visit you,” she declared, “soon, I will.”
“That’s right, you must visit us.”
“Yes, soon, I must.”
But weeks passed over and the widow did not keep her promise
although she only lived a furlong from his door. Pettigrove made no
further invitation for he found excuses on many evenings to visit her.
It was easy to see that she did not care for his wife, and he did not
mind this for neither did he care for her now. The old wish that he
had never been married crept back into his mind, a sly, unsavoury
visitant; it was complicated by a thought that his wife might not live
long, a dark, shameful thought that nevertheless trembled into hope.
So on many of the long winter evenings, while his wife dozed in her
bed, he sat in the widow’s room talking of things that were strange
and agreeable. She could neither understand nor quite forgive his
parochialism; this was sweet flattery to him. He had scarcely ever
set foot outside a ten-mile radius of Tull, but he was an intelligent
man, and all her discourse was of things he could perfectly
understand! For the first time in his life Pettigrove found himself
lamenting the dullness of existence. He tried to suppress this
tendency, but words would come and he was distressed. He had
always been in love with things that lasted, that had stability, that
gave him a recognition and guidance, but now his feelings were
flickering like grass in a gale.
“How strange that is,” she said, when he told her this, “we seem
to have exchanged our feelings. I am happy here, but I know that
dark thought, yes, that life is a dull journey on which the mind
searches for variety, unvarying variety.”
“But what for?” he cried.
“It is constantly seeking change.”
“But for why? It seems like treachery to life.”
“It may be so, but if you seek, you find.”
“What?”
“Whatever you are seeking.”
“What am I seeking?”
“Not to know that is the blackest treachery to life. We are growing
old,” she added inconsequently, stretching her hands to the fire. She
wore black silk mittens.
“Perhaps that’s it,” he allowed, with a laugh. “Childhood’s best.”
“Surely not,” she protested.
“Ah, but I was gay enough then. I’m not a religious man, you
know—and perhaps that’s the reason—but however—I can
remember things of great joy and pleasure then.”
And it seemed from his recollections that not the least pleasant
and persistent was his memory of the chapel, a Baptist hall long
since closed and decayed, to which his mother had sent him on
Sunday afternoons. It was a plain, tough, little tabernacle, with
benches of deal, plain deal, very hard, covered with a clear varnish
that smelled pleasant. The platform and its railing, the teacher’s
desk, the pulpit were all of deal, the plainest deal, very hard and all
covered with the clear varnish that smelled very pleasant. And
somehow the creed and the teacher and the attendants were like
that too, all plain and hard, covered with a varnish that was
pleasant. But there was a way in which the afternoon sun beamed
through the cheap windows that lit up for young Pettigrove an
everlasting light. There were hymns with tunes that he hoped would
be sung in Paradise. The texts, the stories, the admonitions of the
teachers, were vivid and evidently beautiful in his memory. Best of
all was the privilege of borrowing a book at the end of school time—
Pilgrim’s Progress or Uncle Tom’s Cabin.
For a While his recollections restored him to cheerfulness, but his
dullness soon overcame him again.
“I have been content all my life. Never was a man more content.
And now! It’s treachery if you like. My faith’s gone, content gone, for
why?”
He rose to go, and as he paused at the door to bid her good-night
she took his hand and softly and tenderly said: “Why are you
depressed? Don’t be so. Life is not dull, it is only momentarily
unkind.”
“Ah, I’ll get used to it.”
“John Pettigrove, you must never get used to dullness, I forbid
you.”
“But I thought Tull was beautiful,” he said as he paused upon the
doorsill. “I thought Tull was beautiful....”
“Until I came?” It was so softly uttered and she closed the door so
quickly upon him. They called “Good-night, good-night” to each
other through the door.
He went away through the village, his mind streaming with
strange emotions. He exulted, and yet he feared for himself and for
the widow, but he could not summon from the depths of his mind
what it was he feared. He passed a woman in the darkness who,
perhaps mistaking him for another, said “Good-night, my love.”
The next morning he sat in the kitchen after breakfast. It wanted
but a few days to Christmas. There was no frost in the air; the wind
roared, but the day, though grey, was not gloomy; only the man was
gloomy.
“Nothing ever happens,” he murmured. “True, but what would you
want to happen?”
Out in the scullery a village girl was washing dishes; as she rattled
the ware she hummed a song. From his back window Pettigrove
could see a barn in a field, two broken gates, a pile of logs, faggots,
and a single pollarded willow whose head was strangled under a hat
of ivy. Beside a barley stack was a goose with a crooked neck; it
stood sulking. High aloft in the sky thousands of blown rooks
wrangled like lost men. And Pettigrove vowed he would go no more
to the widow—not for a while. Something inside him kept asking,
Why not? And he as quickly replied to himself: “You know, you
know. You’ll find it all in God-a-mighty’s own commandments. Stick
to them, you can’t do more—at least, you might, but what would be
the good?”
So that evening he went along to the Christmas lottery held in a
vast barn, dimly lit and smelling of vermin. A rope hung over each of
its two giant beams, dangling smoky lanterns. There was a crowd of
men and boys inspecting the prizes in the gloomy corners, a pig
sulking in a pen of hurdles, sacks of wheat, live hens in coops, a row
of dead hares hung on the rail of a wagon. Amid silence a man
plunged his hand into a corn measure and drew forth a numbered
ticket; another man drew from a similar measure a blank ticket or a
prize ticket. Each time a prize was drawn a hum of interest spread
through the onlookers, but when the chief prize, the fat pig, was
drawn against number seventy-nine there was agitation, excitement
even.
“Who be it?” cried several. “Who be number seventy-nine for the
fat pig?”
A man consulted a list and said doubtfully: “Miss Subey Jones—
who be she?”
No one seemed to know until a husky alto voice from a corner
piped: “I know her. She’s from Shottsford way, over by Squire
Marchand’s.”
“Oh,” murmured the disappointed men; the husky voice
continued: “Day afore yesterday she hung herself.”
For a few seconds there was a pained silence, until a powerful
voice cried: “It’s a mortal shame, chaps.”
The ceremony proceeded until all the tickets were drawn and all
the prizes won and distributed. The cackling hens were seized from
the pens by their legs and handed upside down to their new owners.
The pig was bundled squealing into a sack. Bags of wheat were
shouldered and the white-bellied hares were held up to the light.
Everybody was animated and chattered loudly.
“I had number thirty in the big chance and I won nothing. And I
had number thirty-one in the little chance and I won a duck. Number
thirty-one was my number, and number thirty in the big draw; I won
nothing in that, but in the little draw I won a duck. Well, there’s flesh
for you.”
Some of those who had won hens held them out to a white-faced
youth who smoked a large rank pipe; he took each fowl quietly by
the neck and twisted it till it died. A few small feathers stuck to his
hands or wavered to the floor, and even after the bird was dead and
carried away it continued slowly and vaguely to flap its big wings
and scatter its lorn feathers.
Pettigrove spent most of the next day in the forest plantation
south of Tull Great Wood, where a few chain of soil had been
cultivated and reserved for seedlings, trees of larch and pine no
bigger than potted geraniums, groves of oaks with stems slender as
a cockerel’s leg and most of the stiff brown leaves still clinging to the
famished twigs; or sycamores, thin but tall, flourishing in a mat of
their own dropped foliage that was the colour of butter fringed with
blood and stained with black gouts like a child’s copy-book. It was a
toy forest, dense enough for the lair of a beast, and dim enough for
an anchorite’s meditations, but a dog could leap over it, and a boy
could stand amid its growth and look like Gulliver in Lilliput.
“May I go into the wood?” a voice called to Pettigrove. Looking
sharply up he saw Mrs. Cronshaw, clad in a long dark blue cloak with
a fur necklet, a grey velvet hat trimmed with a pigeon’s wing
confining her luxuriant hair.
“Ah, you may,” he said, stalking to her side, “but you’d best not,
’tis a heavy marshy soil within and the ways are stabbled by the
hunters’ horses. Better keep out till summer comes, then ’tis dry and
pleasant-like.”
She sat down awkwardly on a heap of faggots, her feet turned
slightly inwards, but her cheeks were dainty pink in the cold air.
What a smart lady! He stood telling her things about the wood, its
birds and foxes; deep in the heart of it all was a lovely open space
covered with the greenest grass and a hawthorn tree in the middle
of that. It bloomed in spring with heavy creamy blossom. No, he had
never seen any fairies there. Come to that, he did not expect to, he
had never thought of it.
“But there are fairies, you know,” cried the widow. “O yes, in old
times, I mean very old times, before the Romans, in fact before
Abraham, Isaac, and Jacob then, the Mother of the earth had a big
family, thousands, something like the old woman who lived in a shoe
she was. And one day God sent word to say he was coming to visit
her. Well, then! She was so excited—the Mother of the earth—that
she made a great to do you may be sure, and after she had made
her house sparkle with cleanliness and had baked a great big pie she
began to wash her children. All of a sudden she heard the trumpets
blow—God was just a-coming! So as she hadn’t got time to finish
them all, she hid those unwashed ones away out of sight, and bade
them to remain there and make no noise or she would be angry and
punish them. But you can’t conceal anything from the King of All and
He knew of those hidden children, and he caused them to be hidden
from mortal eyes for ever, and they are the fairies, O yes!”
“No, nothing can be concealed,” Pettigrove admitted in his slow
grave fashion, “murder will out, as they say, but that’s a tough
morsel if you’re going to swallow it all.”
“But I like to believe in those things I Wish were true.”
“Ah, so, yes,” said Pettigrove.
It was an afternoon of damp squally blusters, uncheering, with
slaty sky; the air itself seemed slaty, and though it had every
opportunity and invitation to fall, the rain, with strange perversity,
held off. In the oddest corners of the sky, north and east, a
miraculous glow could be seen, as if the sun in a moment of
aberration had determined to set just then and just there. The wind
made a long noise in the sky, the smell of earth rose about them, of
timber and of dead leaves; except for rooks, or a wren cockering
itself in a bush, no birds were to be seen.
Letting his spade fall Pettigrove sat down beside the widow and
kissed her. She blushed red as a cherry and he got up quickly.
“I ought not to ha’ done it, I ought not to ha’ done that, Mrs.
Cronshaw!”
“Caroline!” said she, smiling the correction at him.
“Is that your name?” He sat down by her again. “Why, it is the
same as my wife’s.”
And Caroline said “Humph! You’re a strange man, but you are wise
and good. Tell me, does she understand you?”
“What is there to understand? We are wed and we are faithful to
each other, I can take my oath on that to God or man.”
“Yes, yes, but what is faith—without love between you? You see?
You have long since broken your vows to love and cherish,
understand that, you have broken them in half.”
She had picked up a stick and was drawing patterns of cubes and
stars in the soil.
“But what is to be done, Caroline? Life is good, but there is good
living and there is bad living, there is fire and there is water. It is
strange what the Almighty permits to happen.”
A slow-speaking man; scrupulous of thought and speech he
weighed each idea before its delivery as carefully as a tobacconist
weighs an ounce of tobacco.
“Have some cake?” said Caroline, drawing a package from a
pocket. “Will you have a piece ... John?”
She seemed to be on the point of laughing aloud at him. He took
the fragment of cake but he did not eat it as she did. He held it
between finger and thumb and stared at it.
“It’s strange how a man let’s his tongue wag now and again as if
he’d got the universe stuck on the end of a common fork.”
“Or at the end of a knitting needle, yes, I know,” laughed Caroline,
brushing the crumbs from her lap. Then she bent her head, patted
her lips, and regurgitated with a gesture of apology—just like a lady.
“But what are you saying? If there is love between you there is
faithfulness, if there is no love there is no fidelity.”
He bit a mouthful off the cake at last.
“Maybe true, but you must have respect for the beliefs of
others....”
“How can you if they don’t fit in with your own?”
“Or there is sorrow.” He bolted the rest of his cake. “O you are
right, I daresay, Caroline, no doubt; it’s right, I know, but is it
reasonable?”
“There are afflictions,” she said, “which time will cure, so they
don’t matter; but there are others which time only aggravates, so
what can we do? I daresay it’s different with a man, but a woman,
you know, grasps at what she wants. That sounds reasonable, but
you don’t think it’s right?”
In the cold whistling sky a patch of sunset had now begun to
settle in its proper quarter, but as frigid and unconvincing as a stage
fireplace. Pettigrove sat with his great hands clasped between his
knees. Perhaps she grew tired of watching the back of him; she rose
to go, but she said gently enough: “Come in to-night, I want to tell
you something.”
“I will, Caroline.”
Later, when he reached home, he found two little nieces had
arrived, children of some relatives who lived a dozen miles away. A
passing farmer had dropped them at Tull; their parents were coming
a day later to spend Christmas with the Pettigroves.
They sat up in his wife’s room after tea, for Carrie left her bed
only for an hour or two at noon. She dozed against her pillows, a
brown shawl covering her shoulders, while the two children played
by the hearth. Pettigrove sat silent, gazing in the fire.
“What a racket you are making, Polly and Jane!” quavered Carrie.
The little girls thereupon ceased their sporting and took a picture
book to the hearthrug where they examined it in awed silence by the
firelight. After some minutes the invalid called out: “Don’t make such
a noise turning over all them leaves.”
Polly made a grimace and little Jane said: “We are looking at the
pictures.”
“Well,” snapped Mrs. Pettigrove, “why can’t you keep to the one
page!”
John sat by the fire vowing to himself that he would not go along
to the widow, and in the very act of vowing he got up and began
putting on his coat.
“Are you going out, John?”
“There’s a window catch to put right along at Mrs. Cronshaw’s,” he
said. At other times it had been a pump to mend, a door latch to
adjust, or a jamb to ease.
“I never knew things to go like it before—I can’t understand it,”
his wife commented. “What with windows and doors and pumps and
bannisters anyone would think the house had got the rot. It’s done
for the purpose, or my name’s not what it is.”
“It won’t take long,” he said as he went.
The wind had fallen away, but the sky, though clearer, had a dull
opaque mean appearance, and the risen moon, without glow,
without refulgence, was like a brass-headed nail stuck in a kitchen
wall.
The yellow blind at the widow’s cot was drawn down and the
candles within cast upon the blind a slanting image of the birdcage
hanging at the window; a fat dapper bird appeared to be snoozing
upon its rod; a tiny square was probably a lump of sugar; the glass
well must have been half full of water, it glistened and twinkled on
the blind. The shadowy bird shifted one foot, then the other, and
just opened its beak as Pettigrove tapped at the door.
They did not converse very easily, there was constraint between
them, Pettigrove’s simple mind had a twinge of guilt.
“Will you take lime juice or cocoa?” asked the widow, and he said:
“Cocoa.”
“Little or large?”
And he said: “Large.”
While they sat sipping the cocoa Caroline began: “Well, I am
going away, you know. No, not for good, just a short while, for
Christmas only, or very little longer. I must go.”
She nestled her blue shawl more snugly round her shoulders. A
cough seemed to trouble her. “There are things you can’t put on one
side for ever....”
“Even if they don’t fit in with your own ideas!” he said slyly.
“Yes, even then.”
He put down his cup and took both her hands in his own. “How
long?”
“Not long, not very long, not long enough....”
“Enough for what?” He broke up her hesitation. “For me to forget
you? No, no, not in the fifty-two weeks of the whole world of time.”
“I did want to stay here,” she said, “and see all the funny things
country people do now.” She was rather vague about those funny
things. “Carols, mumming, visiting; go to church on Christmas
morning, though how I should get past those dreadful goats, I don’t
know; why are they always in the churchyard?”
“Teasy creatures they are! Followed parson into service one
Sunday, indeed, ah! one of ’em did. Jumped up in his pulpit, too, so
’tis said. But when are you coming back?”
She told him it was a little uncertain, she was not sure, she could
not say, it was a little uncertain.
“In a week, maybe?”
Yes, a week; but perhaps it would be longer, she could not say, it
was uncertain.
“So. Well, all right then, I shall watch for you.”
“Yes, watch for me.”
They gave each other good wishes and said good-bye in the little
dark porch. The shadowy bird on the blind stood up and shrugged
itself. Pettigrove’s stay had scarcely lasted an hour, but in that time
the moon had gone, the sky had cleared, and in its ravishing
darkness the stars almost crackled, so fierce was their mysterious
perturbation. The village man felt Caroline’s arms about him and her
lips against his mouth as she whispered a “God bless you.” He
turned away home, dazed, entranced, he did not heed the stars. In
the darkness a knacker’s cart trotted past him with a dim lantern
swinging at its tail and the driver bawling a song. In the keen air the
odour from the dead horse sickened him.
Pettigrove passed Christmas gaily enough with his kindred, and
even his wife indulged in brief gaieties. Her cousin was one of those
men full of affable disagreements; an attitude rather than an activity
of mind. He had a curious face resembling an owl’s except in its
colour (which was pink) and in its tiny black moustache curling
downwards like a dark ring under his nose. If Pettigrove remarked
upon a fine sunset the cousin scoffed, scoffed benignantly; there
was a sunset every day, wasn’t there?—common as grass, weren’t
they? As for the farming hereabouts, nothing particular in it was
there? The scenery was, well, it was just scenery, a few hills, a few
woods, plenty of grass fields. No special suitability of soil for any
crop; corn would be just average, wasn’t that so? And the roots,
well, on his farm at home he could show mangolds as big as young
porkers, forty to the cartload, or thereabouts. There weren’t no
farmers round here making a fortune, he’d be bound, and as for
their birds, he should think they lived on rook pie.
Pettigrove submitted that none of the Tull farmers looked much
the worse for farming.
“Well, come,” said the other, “I hear your workhouses be middling
full. Now an old neighbour of mine, old Frank Stinsgrove, was a man
as could farm, any mortal thing. He wouldn’t have looked at this
land, not at a crown an acre, and he was a man as could farm, any
mortal thing, oranges and lemons if he’d a mind to it. What a head
that man had, God bless, his brain was stuffed! Full!! He’d declare
black was white, and what’s more he could prove it. I like a man like
that.”
The cousin’s wife was a vast woman, shaped like a cottage loaf.
For some reason she clung to her stays: it could not be to disguise
or curb her bulk, for they merely put a gloss upon it. You could only
view her as a dimension, think of her as a circumference, and
wonder grimly what she looked like when she prepared for the bath.
She devoured turkey and pig griskin with such audible voracity that
her husband declared that he would soon be compelled to wear
corks in his earholes at meal times, yes, the same as they did in the
artillery. She was quite unperturbed by this even when little Jane
giggled, and she avowed that good food was a great enjoyment to
her.
“O ’tis a good thing and a grand thing, but take that child now,”
said her father. Resting his elbow on the table he indicated with his
fork the diminutive Jane; upon the fork hung a portion of meat large
enough to half-sole a lady’s shoe. “She’s just the reverse, she eats
as soft as a fly, a spillikin a day, and not a mite more; no, very dainty
is our Jane.” Here he swallowed the meat and treated four promising
potatoes with very great savagery. “Do you know our Jane is going
to marry a house-painter, yah, a house-painter, or is it a coach-
painter? ’Tis smooth and gentle work, she says, not like rough
farmers or chaps that knock things pretty hard, smiths and
carpenters, you know. O Lord! eight years old, would you believe it?
The spillikin! John, this griskin’s a lovely bit of meat.”
“Beautiful meat,” chanted his wife, “like a pig we killed a month
ago. That was a nice pig, fat and contented as you’d find any pig,
’twould have been a shame to keep him alive any longer. It dressed
so well, a picture it was, the kidneys shun like gold.”
“That reminds me of poor old Frank Stinsgrove,” said her husband.
“He’d a mint of money, a very wealthy man, but he didn’t like
parting with it. He’d got oldish and afraid of his death, must have a
doctor calling to examine him every so often. Didn’t mind spending a
fortune on doctors, but every other way he’d skin a flint. And there
was nought wrong with him, ’cept age. So his daughter ups and says
to him one day—You are wasting your money on all these doctors,
father, they do you no good, what you must have is nice, dainty,
nourishing food. Now what about some of these new laid eggs? How
much are they fetching now? old Frank says. A penny farthing, says
she. A penny farthing! I cannot afford it. And there was that man
with a mint of money, a mint, could have bought Buckingham Palace
—you understand me—and yet he must go on with his porridge and
his mustard plasters and his syrup of squills, until at last a smartish
doctor really did find something the matter with him, in his kidneys.
They operated, mark you, and they say—but I never quite had the
rights of it—they say they gave him a new kidney made of wax; a
new wax kidney, ah, and I believe it was successful, only he had not
to get himself into any kind of a heat, of course, nor sit too close to
the fire. ’Stonishing what they doctors can do with your innards. But
of course he was too old, soon died. Left a fortune, a mint of money,
could have bought the crown of England. Staunch old chap, you
know.”
Throughout the holidays John sang his customary ballads, “The
Bicester Ram,” “The Unquiet Grave,” and dozens of others. After
songs there would be things to eat. Then a game of cards, and after
that things to eat. Then a walk to the inn, to the church, to a farm,
or to a friend’s where, in all jollity, there would be things to eat and
drink. They went to a meet of the hounds, a most successful outing
for it gave them ravening appetites. In short, as the cousin’s wife
said when bidding farewell, it was a time of great enjoyment.
And Pettigrove said so too. He believed it, and yet was glad to be
quit of his friends in order to contemplate the serene dawn that was
to come at any hour now. By New Year’s Day Mrs. Cronshaw had not
returned, but the big countryman was patient, his mind, though not
at rest, was confident. The days passed as invisibly as warriors in a
hostile country, and almost before he had begun to despair February
came, a haggard month to follow a frosty January. Mist clung to the
earth as tightly as the dense grey fur on the back of a cat, ice began
to uncongeal, adjacent lands became indistinct, and distant fields
could not be seen at all. The banks of the roads and the squat
hedges were heavily dewed. The cries of invisible rooks, the bleat of
unseen sheep, made yet more gloomy the contours of motionless
trees wherefrom the slightest movement of a bird fetched a splatter
of drops to the road, cold and uncheering.
All this inclemency crowded into the heart of the waiting man, a
distress without a gleam of anger or doubt, but only a fond anxiety.
Other anxieties came upon him which, without lessening his
melancholy, somewhat diverted it: his wife suffered a sudden grave
decline in health, and on calling in the doctor Pettigrove was made
aware of her approaching end. Torn between a strange recovered
fondness for his sinking wife and the romantic adventure with the
widow, which, to his mind at such a juncture, wore the sourest
aspect of infidelity, Pettigrove dwelt in remorse and grief until the
night of St. Valentine’s Day, when he received a letter. It came from
a coast town in Norfolk, from a hospital; Caroline, too, was ill. She
made light of her illness, but it was clear to him now that this and
this alone was the urgent reason of her retreat from Tull at
Christmas. It was old tubercular trouble (that was consumption,
wasn’t it?) which had driven her into sanatoriums on several
occasions in recent years. She was getting better now, she wrote,
but it would be months before she would be allowed to return. It
had been rather a bad attack, so sudden. Now she had no other
thought or desire in the world but to be back at Tull with her friend,
and in time to see that fairy may tree at bloom in the wood—he had
promised to show it to her—they would often go together, wouldn’t
they—and she signed herself his, “with the deepest affection.”
He did not remember any promise to show her the tree, but he sat
down straightway and wrote her a letter of love, incoherently
disclosed and obscurely worded for any eyes but hers. He did not
mention his wife; he had suddenly forgotten her. He sealed the letter
and put it aside to be posted on the morrow. Then he crept back to
his wife’s room and continued his sick vigil.
But in that dim room, lit by one small candle, he did not heed the
invalid. His mind, feverishly alert, was devoted to thoughts of that
other who also lay sick, and who had intimidated him. He had feared
her, feared for himself. He had behaved like a lost wanderer who at
night, deep in a forest, had come upon the embers of a fire left
mysteriously glowing, and had crept up to it frightened, without stick
or stone: if only he had conquered his fear he might have lain down
and rested by its strange comfort. But now he was sure of her love,
sure of his own, he was secure, he would lay down and rest. She
would come with all the sweetness of her passion and the valour of
her frailty, stretching smooth, quiet wings over his lost soul.
Then he began to be aware of a soft, insistent noise, tapping,
tapping, tapping, that seemed to come from the front door below. To
assure himself he listened intently, and soon it became almost the
only sound in the world, clear but soft, sharp and thin, as if struck
with the finger nails only, tap, tap, tap, quickly on the door. When
the noise ceased he got up and groped stealthily down his narrow
crooked staircase. At the bottom he waited in an uncanny pause
until just beyond him he heard the gentle urgency again, tap, tap,
and he flung open the door. There was enough gloomy light to
reveal the emptiness of the porch; there was nothing there, nothing
to be seen, but he could distinctly hear the sound of feet being
vigorously shuffled on the doormat below him, as if the shoes of
some light-foot visitor were being carefully cleaned before entry.
Then it stopped. Beyond that—nothing. Pettigrove was afraid, he
dared not cross the startling threshold, he shot back the door, bolted
it in a fluster, and blundered away up the stairs.
And there was now darkness, the candle in his wife’s room having
spent itself, but as a glow from the fire embers remained he did not
hasten to light another candle. Instead, he fastened the bedroom
door also, and stood filled with wondering uneasiness, dreading to
hear the tap, tap, tap come again, just there, behind him. He
listened for it with stopped breath, but he could hear nothing, not
the faintest scruple of sound, not the beat of his own heart, not a
flutter from the fire, not a rustle of feet, not a breath—no! not even
a breathing! He rushed to the bed and struck a match: that was a
dead face.... Under the violence of his sharpening shock he sank
upon the bed beside dead Carrie and a faint crepuscular agony
began to gleam over the pensive darkness of his mind, with a
promise of mad moonlight to follow.
Two days later a stranger came to the Pettigrove’s door, a short
brusque, sharp-talking man with iron-grey hair and iron-rimmed
spectacles. He was an ironmonger.
“Mr. Pettigrove? My name is Cronshaw, of Eastbourne, rather
painful errand, my sister-in-law, Mrs. Cronshaw, tenant of yours, I
believe.”
Pettigrove stiffened into antagonism: what the devil was all this?
“Come in,” he remarked grimly.
“Thank you,” said Cronshaw, following Pettigrove into the parlour
where, with many sighs and much circumstance, he doffed his
overcoat and stood his umbrella in a corner. “Had to walk from the
station, no conveyances; that’s pretty stiff, miles and miles.”
“Have a drop of wine?” invited Pettigrove.
“Thank you,” said the visitor.
“It’s dandelion.”
“Very kind of you, I’m sure.” Cronshaw drew a chair up to the
fireplace, though the fire had not been lit, and the grate was full of
ashes, and asked if he might smoke. Pettigrove did not mind; he
poured out a glass of the yellow wine while Cronshaw lit his pipe.
The room smelled stuffy, heavy noises came from overhead as if
men were moving furniture. The stranger swallowed a few drops of
the wine, coughed, and said: “My sister-in-law is dead, I’m sorry to
say. You had not heard, I suppose?”
“Dead!” whispered Pettigrove. “Mrs. Cronshaw! No, no, I had not,
I had not heard that, I did not know. Mrs. Cronshaw dead—is it
true?”
“Ah,” said the stranger with a laboured sigh. “Two nights ago in a
hospital at Mundesley. I’ve just come on from there. It was very
sudden, O, frightfully sudden, but it was not unexpected, poor
woman, it’s been off and on with her for years. She was very much
attached to this village, I suppose, and we’re going to bury her here,
it was her last request. That’s what I want to do now. I want to
arrange about the burial and the disposal of her things and to give
up possession of your house. I’m very sorry for that.”
“I’m uncommon grieved to hear this,” said Pettigrove. “She was a
handsome lady.”
“O yes,” the ironmonger took out his pocket-book and prepared to
write in it.
“A handsome lady,” continued the countryman tremulously,
“handsome, handsome.”
At that moment someone came heavily down the stairs and
knocked at the parlour door.
“Come in,” cried Pettigrove. A man with red face and white hair
shuffled into the room; he was dressed in a black suit that had been
made for a man not only bigger, but probably different in other
ways.
“We shall have to shift her down here now,” he began. “I was sure
we should, the coffin’s too big to get round that awkward crook in
these stairs when it’s loaded. In fact, ’tis impossible. Better have her
down now afore we put her in, or there’ll be an accident on the day
as sure as judgment.” The man, then noticing Cronshaw, said:
“Good-morning, sir, you’ll excuse me.”
The ironmonger stared at him with horror, and then put his
notebook away.
“Yes, yes, then,” mumbled Pettigrove. “I’ll come up in a few
minutes.”
The man went out and Cronshaw jumped up and said: “You’ll
pardon me, Mr. Pettigrove, I had no idea that you had had a
bereavement too.”
“My wife,” said Pettigrove dully, “two nights ago.”
“Two nights ago! I am very sorry, most sorry,” stammered the
other, picking up his umbrella and hat. “I’ll go away. What a sad
coincidence!”
“There’s no call to do that; what’s got to be done must be done.”
“I’ll not detain you long then, just a few details: I am most sorry,
very sorry, it’s extraordinary.”
He took out his notebook again—it had red edges and a fat elastic
band—and after conferring with Pettigrove for some time the
stranger went off to see the vicar, saying, as he shook hands: “I
shall of course see you again when it is all over. How bewildering it
is, and what a shock it is; from one day to another, and then
nothing; and the day after to-morrow they’ll be buried beside one
another. I am very sorry, most sorry. I shall of course come and see
you again when it is all over.”
After he had gone Pettigrove walked about the room murmuring:
“She was a lady, a handsome lady,” and then, still murmuring, he
stumbled up the stairs to the undertakers. His wife lay on the bed in
a white gown. He enveloped her stiff thin body in a blanket and
carried it downstairs to the parlour; the others, with much difficulty,
carried down the coffin and when they had fixed it upon some
trestles they unwrapped Carrie from the blankets and laid her in it.
Caroline and Carrie were buried on the same day in adjoining
graves, buried by the same men, and as the ironmonger was
prevented by some other misfortune from attending the obsequies
there were no other mourners than Pettigrove. The workshop sign of
the Tull carpenter bore the following notice:

Small
☞ COMPLETE UNDERTAKER Hearse
Kept.

and therefore it was he who ushered the handsome lady from the
station on that bitter day. Frost was so heavy that the umbrage of
pine and fir looked woolly, thick grey swabs. Horses stood miserably
in the frozen fields, breathing into any friendly bush. Rooks pecked
industriously at the tough pastures, but wiser fowls, unlike the
fabulous good child, could be neither seen nor heard. And all day
someone was grinding corn at the millhouse; the engine was old and
kept on emitting explosions that shook the neighbourhood like a
dreadful bomb. Pettigrove, who had not provided himself with a
black overcoat and therefore wore none at all, shivered so intensely
during the ceremony that the keen edge of his grief was dulled, and
indeed from that time onwards his grief, whatever its source,
seemed deprived of all keenness: it just dulled him with a
permanent dullness.
He caused to be placed on his wife’s grave a headstone, quite
small, not a yard high, inscribed to
Caroline
The beloved wife
of
John Pettigrove
Some days after its erection he was astonished to find the
headstone had fallen flat on its face. It was very strange, but after
all it was a small matter, a simple affair, so in the dusk he himself
took a spade and set it up again. A day or two later it had fallen
once more. He was now inclined to some suspicion, he fancied that
mischievous boys had done it; he would complain to the vicar. But
Pettigrove was an easy-going man, he did not complain; he replaced
the stone, setting it more deeply in the earth and padding the turf
more firmly around it.
When it fell the third time he was astonished and deeply moved,
but he was no longer in doubt, and as he once more made a good
upheaval by the grave in the dusk he said in his mind, and he felt
too in his heart, that he understood.
“It will not fall again,” he said, and he was right: it did not.
Pettigrove himself lived for another score of years, during which
the monotony of his life was but mildly varied; he just went on
registering births and deaths and rearing little oaks and pines, firs
and sycamores. Sentimental deference to the oft-repeated wish of
his wife led him to join the church choir and sing its anthems and
hymns with a secular blitheness that was at least mellifluous.
Moreover, after a year or two, he did become a parish councillor and
in a modest way was something of a “shining light.”
“If I were you,” observed an old countryman to him, “and I had
my way, I know what I would do: I would live in a little house and
have a quiet life, and I wouldn’t care the toss of a ha’penny for
nothing and nobody!”
In the time of May, always, Pettigrove would wander in Tull Great
Wood as far as the hidden pleasaunce where the hawthorn so
whitely bloomed. None but he knew of that, or remembered it, and
when its dying petals were heaped upon the grass he gathered
handfuls to keep in his pocket till they rotted. Sometimes he thought
he would leave Tull and see something of the world; he often
thought of that, but it seemed as if time had stabilized and
contracted round his heart and he did not go. At last, after twenty
years of widowhood, he died and was buried, and this was the
manner of that.
Two men were digging his grave on the morning of the interment,
a summer’s day so everlasting beautiful that it was incredible anyone
should be dead. The two men, an ancient named Jethro and a
younger whom he called Mark, went to sit in the cool porch for a
brief rest. The work on the grave had been very much delayed, but
now the old headstone was laid on one side, and most of the earth
that had covered his wife’s body was heaped in untidy mounds upon
the turf close by. Otherwise there was no change in the yard or the
trees that grew so high, the grass that grew so greenly, the dark
brick wall, or the door of fugitive blue; there was even a dappled
goat quietly cropping. A woman came into the porch, remarked upon
the grand day, and then passed into the church to her task of tidying
up for the ceremony. Jethro took a swig of drink from a bottle and
handed it to his mate.
“You don’t remember old Fan as used to clean the church, do you?
No, ’twas ’fore you come about these parts. She was a smartish old
gal. Bother me if one of they goats didn’t follow her into the darn
church one day, ah, and wouldn’t be drove out on it, neither, no, and
she chasing of it from here to there and one place and another but
out it would not go, that goat. And at last it act-u-ally marched up
into the pulpit and putt its two forelegs on the holy book and said
’Baa-a-a!’” Here Jethro gave a prolonged imitation of a goat’s cry.
“Well, old Fan had been a bit skeered but she was so overcome by
that bit of piety that, darn me, if she didn’t sit down and play the
organ for it!”
Mark received this narration with a lack-lustre air and at once the
two men resumed their work. Meanwhile a man ascended the
church tower; other men had gone into the home of the dead man.
Soon the vicar came hurrying through the blue door in the wall and
the bell gave forth its first solemn toll.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookname.com

You might also like