100% found this document useful (14 votes)
84 views

Complete Download Start Programming Using HTML CSS and JavaScript 1st Edition Iztok Fajfar (Author) PDF All Chapters

Start

Uploaded by

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

Complete Download Start Programming Using HTML CSS and JavaScript 1st Edition Iztok Fajfar (Author) PDF All Chapters

Start

Uploaded by

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

Download the full version of the ebook 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

DOWNLOAD EBOOK

Download more ebook instantly today at https://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


Random documents with unrelated
content Scribd suggests to you:
The Project Gutenberg eBook of Caleb
Conover, Railroader
This ebook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this ebook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

Title: Caleb Conover, Railroader

Author: Albert Payson Terhune

Illustrator: Frank Parker

Release date: February 11, 2022 [eBook #67374]

Language: English

Original publication: United States: Cupples & Leon Company

Credits: Richard Tonsing and the Online Distributed Proofreading


Team at https://www.pgdp.net (This file was produced
from images generously made available by The
Internet Archive)

*** START OF THE PROJECT GUTENBERG EBOOK CALEB CONOVER,


RAILROADER ***
Transcriber’s Note:
The cover image was created by the transcriber
and is placed in the public domain.

Something swished through the


air from behind Clive’s head.
Page 137.
Caleb Conover, Railroader

By
ALBERT PAYSON TERHUNE
Author of “Syria from the Saddle,” “Dr. Dale” (in collaboration with Marion
Harland), “Columbia Stories,” Etc.

New York
CUPPLES & LEON COMPANY
Publishers
Copyright, 1907, by
ALBERT PAYSON TERHUNE.

Entered at Stationers’ Hall.


All rights reserved.
CONTENTS
CHAPTER PAGE

I. Caleb Conover Receives 5

II. Caleb Conover Makes a Speech 27

III. Caleb Conover Regrets 44

IV. In Two Camps 74

V. A Meeting, an Interruption and a Letter 90

VI. Caleb Works at Long Range 115

VII. Caleb Undergoes a “Home Evening” 145

VIII. Caleb Conover Listens and Answers 173

IX. A Convention and a Revelation 193

X. Anice Intervenes 207

XI. Caleb Conover Makes Terms 227

XII. Caleb Conover Fights 247

XIII. The Fourth Messenger of Job 272

XIV. Caleb Conover Loses and Wins 291

XV. Dunderberg Solves the Difficulty 314


(Facsimile Page of Manuscript
from CALEB CONOVER,
Railroader)
CALEB CONOVER,
RAILROADER
CHAPTER I
CALEB CONOVER RECEIVES

“The poor man!” sighed Mrs. Greer. “He must think he’s a
cemetery!”
The long line of carriages was passing solemnly through a mighty
white marble arch, aglare with electric light, leading into the “show
place” of Pompton Avenue.
Athwart the arch’s pallid face, in raised letters a full foot in length
were the words:
“CALEB CONOVER, R.R., 1893.”
In the ghastly, garish illumination, above the slow-moving
procession of sombre vehicles, the arch and its inscription gave
gruesome excuse for Mrs. Greer’s comment. She herself thought the
phrase rather apt, and stored it away for repetition.
Her husband, a downy little man, curled up miserably in the other
corner of the brougham, read her thought, from long experience, and
twisted forward into what he liked to think was a commanding
attitude.
“Look here!” he protested. “You’ve got to stop that. It’s bad enough
to have to come here at all, without your spoiling everything with one
of those Bernard Shawisms of yours. Why, if it ever got back to
Conover’s ears——”
“He’d withdraw his support? And then good-by to Congress for the
unfortunate Talbot Firth Greer?”
“Just that. He’ll stand all sorts of criticism about his start in life. In
fact, he revels in talking of his rise to anyone who’ll listen. But when
it comes to guying anything in his present exalted——”
“What does the ‘R. R.’ at the end of his name over the gate stand
for? I’ve seen the inscription often enough, but——”
“‘Railroader.’ He uses it as a sort of title. Life for him is one long
railroad, and——”
“And now we’re to do him honor at the terminus?”
“If you like to put it that way. Perhaps ‘junction’ would hit it closer.
It was awfully good of you, Grace, to come. I——”
“Of course it was. If I didn’t want a try at Washington I’d never
have dared it. It will be in all the papers to-morrow. He’ll see to that.
And then—I hate to think what everyone will say. I suppose we’re the
first civilized people who ever passed under that atrocious hanging
mortuary chapel, aren’t we?”
“Hardly as bad as that. If it’s any comfort to you, there are plenty
more in the same box as ourselves, to-night.”
“But surely everybody in Granite can’t want to run for Congress?”
“No. But enough people have axes of their own to grind to make it
worth their while to visit the Conover whetstone. When a man who
can float companies at a word, boom or smash a dozen different
stocks, swing the Legislature, make himself heard from here to
Washington, and carries practically every newspaper in the
Mountain State in his vest pocket; when——”
“When such a man whistles, there are some people who find it wise
not to be deaf. But what on earth does he want us for?”
“The world-old ambition that had its rise when Cain and Abel
began moving in separate sets. The longing to ‘butt in,’ as Caleb
himself would probably call it. He has everything money and political
power can give. And now he wants the only thing left—what he terms
‘social recognition.’”
“And we are to help——”
“No. We’re to let him think we help. All the king’s horses and all
the king’s men, assisted by a score of Conover’s own freight derricks,
couldn’t hoist that cad into a decent crowd. He’s been at it ever since
he got his first million and married poor little Letty Standish. She
was the fool of her family, and a broken family at that. But still it was
a family. Yet it didn’t land Caleb anywhere. Then, when that unlicked
cub of a son of his grew up, he made another try. But you know how
that turned out. Now that his daughter’s captured a more or less
authentic prince, I suppose he thinks the time has come. Hence to-
night’s——”
“What a blow to his hopes it must have been to have the girl marry
in Paris instead of here at Granite! But I suppose the honeymoon in
America and this evening’s reception are the next best thing. Are we
never to get there?”
“Soon enough, I’m afraid. Conover boasts that he’s laid out his
grounds so that the driveway is a measured half-mile. We’ll be there
in another minute or so.”
Mrs. Greer laughed a little nervously.
“It’ll be something to remember anyway,” said she. “I suppose all
sorts of horrible people will be there. I read a half-page account of it
this morning in the Star, and it said that ‘while the proudest families
of Granite would delight to do Mr. Conover honor, the humbler
associates of political and business life would also be present.’ Did
you ever hear anything more delicious? And in the Star, too!”
“His own paper. Why not? I suppose we’re the ‘proudest families’;
and the ‘humbler associates’ are some of the choice retinue of heelers
who do his dirty work. Lord! what a notice of it there’ll be in to-
morrow’s papers! Washington will have to be very much worth while
to make up for this. If only I——”
“Hush!” warned Mrs. Greer, as the carriage lurched to a halt, in the
pack before a great porte-cochère. “We’re actually here at last. See!
There goes Clive Standish up the steps with the Polissen girls and old
Mr. Polissen. There are a few real human beings here, after all. Why
do you suppose——?”
“H’m!” commented Greer, “Polissen’s ‘long’ on Interstate Canal,
the route Conover’s C. G. & X. Road is threatening to put out of
business. But why young Standish——”
“Why not? Letty Conover’s own nephew. Though I did hear he and
the Conovers were scarcely on speaking terms. He——”
“I fancy that’s because Standish’s ‘Mayflower’ back is too stiff to
bend at the crack of Caleb’s whip. He could have made a mighty good
thing of his law business if Conover had backed him. But I
understand he refuses to ally himself with his great relative-in-law,
and prefers a good social position and a small law practice——”
“Rather than go to Congress?” finished his wife with such sweet
innocence that Greer could only glare at her with flabby helplessness.
Before he could think of an apt retort, the brougham was at the foot
of the endless marble steps, and its late occupants were passing up a
wide strip of velvet between rows of vividly liveried footmen.

Caleb Conover, Railroader, was standing just within the wide


doorway of a drawing-room that seemed to stretch away into infinity.
Behind rose an equally infinite vista of heads and shoulders. But the
loudly blended murmur of many voices that is the first thing to strike
the ear of arriving guests at such functions was conspicuously absent.
The scarce-broken hush that spread through the chain of rooms
seemed to bear out still further Mrs. Greer’s mortuary simile.
But the constraint in no way extended to the host himself. The
strong, alert face, with its shrewd light eyes and humorous mouth,
was wreathed in welcoming smiles that seemed to ripple in a series
of waves from the close-cut reddish hair to the ponderous iron jaw.
The thickset form of the Railroader, massive of shoulder and sturdily
full of limb, was ever plunging forward to grip some favored
newcomer by the hand, or darting to one side or the other as he
whispered instructions to servant or relative.
“I congratulate you on your friend’s repose of manner!” whispered
Mrs. Greer, as she and her husband awaited their turn. “He has all
the calm self-assurance of a jumping jack.”
“But there are springs of chilled steel in the jumping jack,”
whispered Greer. “He’s out of his element, and he knows it. But he
isn’t so badly confused for all that. If you saw him at a convention or
a board meeting, you wouldn’t know him for the same——”
“And there’s his poor little wife, looking as much like a rabbit as
ever! She’s a cipher here; and even her husband’s figure in front of
her doesn’t raise the cipher to the tenth power. I suppose that is the
daughter, to Mrs. Conover’s left? The slender girl with the rust-
colored hair and the brown eyes? She’s prettier and more of a
thoroughbred in looks than I should have——”
“That’s not his daughter. That’s Miss Lanier, Conover’s secretary.
His daughter is the——”
“His secretary? Why, is she receiving?”
“She is his secretary and everything else. She came here three
years ago as Blanche’s governess. To give the poor girl a sort of
winding-up polish before Caleb sent her to Europe. She made all
sorts of a hit with Conover. Principally because she’s the only person
on earth who isn’t afraid of him, so I hear. And now she is secretary,
and major domo, and ‘right-hand man,’ and I don’t know what not
else. Mrs. Conover’s only a ‘cipher,’ as you say, and Miss Alice Lanier
—not Caleb—is the ‘figure’ in front of her. That’s the new-made
princess, to the right. The tall one with the no-colored hair. I suppose
that’s the Prince d’Antri beside her.”
“He’s too handsome to be a very real prince. What a face for a
sculptor or——”
“Or a barber. A beard like that——”
A gorgeously apparelled couple just in front of the Greers, in the
line, moved forward within the zone of Conover’s greeting. Caleb
nodded patronizingly to the man, and more civilly to the woman.
“Mr. Conover,” the latter was murmuring in an anguish of
respectful embarrassment, “’tis a great honor you do me and the
man, askin’ us here to-night with all your stylish friends, an’——”
“Oh, there’s more than your husband and me, here, who’d get
hungry by habit if they heard a noon whistle blow,” laughed Conover,
as with a jerk of his red head and a word of pleasant welcome, he
passed them on down the reception line. Then the Railroader’s light,
deep-set eyes fell on Greer, and he stepped forward, both hands
outstretched.
“Good evening, Greer!” he cried, and there was a subcurrent of
latent power in his hearty voice. “Good evening! Pleased to see you in
my house. Mrs. Greer, I presume? Most kind of you to come, ma’am.
Proud to make your acquaintance. Letty!”—summoning with a jerk of
the head an overdressed, frightened-looking little woman from the
line behind him—“Letty, this is my very good friend, Mr. Talbot Firth
Greer—Mrs. Conover—Mr. and Mrs. Greer. Mr. Greer is the next
Congressman from the Eleventh District. (That’s a little prophecy,
Mr. Greer. You can gamble on its coming true.) My daughter,
Princess d’Antri—Mr. and Mrs. Greer. Prince Amadeo d’Antri. My
secretary, Miss Anice Lanier—Mr. and Mrs.——”
A new batch of guests swarmed down the hall toward the host, and
the ordeal was over. The Greers, swept on in the rush, did not hear
Conover’s next greeting. This was rather a pity, since it differed
materially from that lavished upon themselves.
Its recipient was a big young man, with a shock of light hair and
quiet, dark eyes. He wore his clothes well, and looked out of place in
his vulgar, garish surroundings. Caleb Conover, Railroader, eyed the
newcomer all over with a cold, expressionless glance. A glance that
no seer on earth could have read; the glance that had gained him
more than one victory when wits and concealment of purpose were
rife. Then he held out a grudging hand.
“Well, Mr. Clive Standish,” he observed, “it seems the lion and the
lamb lie down together, after all—a considerable distance this side of
the millennium. And the lamb inside, at that. To think of a clubman
and a cotillon leader, and a first-families scion and a Civic Leaguer
and all that sort of thing condescending to honor my poor shanty
——”
“My aunt, Mrs. Conover, wrote, asking me especially to come, as a
favor to her,” replied the younger man stiffly. “I thought——”
“And you were O. K. in thinking it. I know Letty wrote, because I
dictated the letter. I wanted to count you in with the rest to-night,
and I had a kind of bashful fear that your love for me, personally,
might not be strong enough to fetch you. You’ve got too much sense
to think the invite will score either way in our feelings to each other,
or that I’m going back on what I said to you four years ago. Now that
you’re here, chase in and enjoy yourself. This place is like heaven, to-
night, in one way. You’ll see a whole lot of people here you never
expected to, and you’ll miss more’n a few you thought would sure
belong. Good-by. Don’t let me block your job of heavenly
recognition.”
The wilful coarseness and brutality of the man came as no surprise
to Standish. He had expected something of the sort, and had braced
himself for it. To please his aunt, whom he sincerely pitied, he had
entered the Conover house to-night for the first time since the
Homeric quarrel, incident on his refusal to avail himself of Caleb’s
prestige in his law work, and, incidentally to enroll himself as one of
the Railroader’s numberless political vassals. That the roughness to
which Conover had just subjected him was no more a part of the
former’s real nature than had been the nervous effusiveness of his
greeting to the Greers, Clive well knew. It had been intended to cover
any embarrassing memories of a former and somewhat less strained
acquaintanceship; and as such it—like most of Conover’s moves—had
served its turn.
So, resisting his first impulse to depart as he had come, Standish
moved on. The formal receiving phalanx was crumpling up. He
paused for a moment’s talk with little Mrs. Conover, exchanged a
civil word or two with his cousin Blanche and her prince, and then
came to where Anice Lanier was trying to make conversation for
several awed-looking, bediamonded persons who were evidently
horribly ill at ease in their surroundings.
At sight of the girl, the formal lines about Clive’s mouth were
broken by a smile of very genuine pleasure. A smile that gave a
younger aspect to his grave face, and found ready answer in the
brown eyes that met his.
“Haven’t you toiled at a forlorn hope long enough?” he asked, as
the awed beings drifted away into the uncomfortable crowd, carrying
their burden of jewels with them.
“A forlorn hope?” she queried, puzzled.
“You actually seemed to be trying to galvanize at least a segment of
this portentous gathering into a semblance of life. Don’t do it. In the
first place you can’t. Saloonkeepers and Pompton Avenue people
won’t blend. In the second place, it isn’t expected of you. The papers
to-morrow will record the right names just as jealously as if every
one had had a good time. Suppose you concentrate all your efforts on
me. Come! It will be a real work of charity. For Mr. Conover has just
shown me how thoroughly I’m the prodigal. And he didn’t even hint
at the whereabouts of a fatted calf. Please be merciful and make me
have a good time. It’s months since I’ve seen you to talk to.”
“Then why don’t you come here oftener?” she asked, as they made
their way through the press, and found an unoccupied alcove
between two of the great rooms. “I’m sure Mrs. Conover——”
“My poor aunt? She’d be frightened to death that Conover and I
would quarrel. No, no! To-night is an exception. The first and the
last. I persuaded myself I came because of Aunt Letty’s note. But I
really came for a chat with you.”
She looked at him, doubting how to accept this bald compliment.
But his face was boyish in its sincerity.
“You and I used to be such good friends,” he went on, “and now we
never see any more of each other. Why don’t we?”
“I think you know as well as I. You no longer come here—you have
not come, I think, since a year before I arrived. And I go almost
nowhere since——”
“Since you gave up all your old world and the people who cared for
you and became a drudge in the Conover household? If you were to
be found anywhere else, you would see so much of me that I’d bore
you to extinction. But it would be even unpleasanter for you than for
me if I were to call on you here. I miss our old-time talks more than I
can say.”
“I miss them, too. Do you remember how we used to argue over
politics, and how you always ended by telling me that there were two
things no woman could understand, and that politics was one and
finance the other?”
“And you would always make the same retort: That woman’s
combined ignorance of politics and finance were pure knowledge as
compared with the men’s ignorance of women. It wasn’t especially
logical repartee, but it always served to shut me up.”
“I wish we had time for another political spat. Some day we must.
You see, I’ve learned such a lot about politics—and finance, too—
practical politics and finance—since I came here.”
“Decidedly ‘practical,’ I fancy, if Mr. Conover was your teacher. He
doesn’t go in much for idealism.”
“And you?” asked Anice, ignoring the slur. “Are you still as rabid as
ever in your ideas of reform? But, of course, you are. For I read only
last week that you had been elected President of the Civic League. I
want to congratulate you. It’s a splendid movement, even though Mr.
Conover declares it’s hopeless.”
“Good citizenship is never quite hopeless, even in a boss-ridden
community like Granite, and a boss-governed commonwealth like
the Mountain State. The people will wake up some day.”
“Their snores sound very peaceful and regular just now,” remarked
Anice, with a flippancy whereof she had the grace to be ashamed.
“Perhaps,” he smiled, “the sounds you and Conover mistake for
snores may possibly be groans.”
“How delightfully dramatic! That would sound splendidly on the
stump.”
“It may have a chance to.”
“What do you mean? Are you going to——”
“No. I am going to run for governor this fall.”
“WHAT?”
“Do you know,” observed Standish, “when you open your eyes that
way you really look——”
“Never mind how I look! Tell me about——”
“My campaign? It is nothing yet. But the Civic League is planning
one more effort to shake off Conover’s grip on the throat of the
Mountain State—another good ‘stump’ line, by the way. And I have
been asked to run for governor.”
“But——”
“Oh, yes, I know. Conover holds the Convention in the hollow of
his hand. He owns the delegates and the newspapers and the
Legislature as well as the railroads. And no sane man would dream of
bucking such a combination. But maybe I’m not quite sane. For I’m
going to try it. Now laugh all you like.”
“Laugh? I feel more like crying. It’s—it’s knightly and splendid of
you, Clive! And—perhaps it may prove less crazy than you think.”
“You mean?”
“I mean nothing at all. I wish you luck, though. All the luck in the
world. Tell me more.”
“There is no more. Besides, I’d rather talk about you. Tell me of
your life here.”
“There’s nothing to tell. It’s work. Pleasant enough work, even
though it’s hard. Everyone is nice to me. I——”
“That doesn’t explain your choosing such a career out of all that
were open to you. Why did you take it?”
“I’ve often explained it to you, but you never seem to understand.
When father died, he left me nothing. I had my living to make, and
——”
“But surely there were a thousand easier, pleasanter ways of
earning it than to kill yourself socially by becoming an employee in
such a family as this. It can’t be congenial——”
The odd smile in her eyes checked him and gave him a vague sense
of uneasiness.
“It is congenial,” said the girl after a pause. “I have my own suite of
rooms, my own hours, my own way. I have a natural bent for finance,
and business association with Mr. Conover is a real education. The
salary is good. My word in all household matters is law. Mr. Conover
knows I understand how things should be conducted, and he has
grown to rely on me. I am more mistress here than most women in
their own homes. Mrs. Conover is ill so much—and Blanche being
away——”
“Anice,” he broke in, “I’ve known you since you first went into long
dresses. And I know that the reasons you’ve just given are none of
them the sort that appeal to a girl like you. To some women they
might. But not to you. Why did you come here, and why do you stay?
There is some reason you haven’t——”
“’Scuse me, Miss Lanier,” said a voice at the entrance of the alcove,
“the Boss sent me to ask you would you come to the drorin’-room. He
says the supper-room’s open, an’ he’d like you to soop’rintend things.
I’ve been lookin’ everywhere for you. Gee, but goin’ through a bunch
of cops in a pool-room raid is pie alongside of workin’ a way through
this push.”
The speaker was a squat, swarthy little man on whom his ready-
made evening clothes sat with the grace and comfort of a set of
thumb screws. Clive recognized him with difficulty as the usually
self-assured “Billy” Shevlin, Conover’s most trusted political
henchman.
“Very well,” replied Anice Lanier, rising to obey the summons. She
noted the dumb misery in Billy’s face, and paused to ask:
“Aren’t you having a good time, Mr. Shevlin?”
“A good time? Me? Oh, yes. Sure, I am. I only hope no one’ll
mistake me in this open-face suit for a senator or a mattinay idol.
That’s all that’s botherin’ me. I’ve been rubbin’ elbows with the Van
Alstynes that own half of Pompton Av’no and live in Yoorup, and
with Slat Kerrigan’s wife, who used to push coffee and sinkers at
Kerry’s beanery. Oh, I’m in sassiety all right. An’ I feel like a pair of
yeller shoes at a fun’ral.”
“Never mind!” laughed Anice. “The supper-room’s open, and you’ll
enjoy that part of the evening, at any rate.”
“I will, eh? Not me, Miss! The Boss’s passed the word that the boys
is to hold back, and kind of make a noise like innercent bystanders
till the swell push is all fed. So it’s me for the merry outskirts while
they’re gettin’ their money’s wort’.”
Clive Standish watched them thread their way through the crowd,
until Anice’s dainty little head with its crown of shimmering bronze
hair was lost to sight. Then he sat looking moodily out on the
heterogeneous, ill-assorted company before him.
Now that he had talked with Anice he no longer regretted the
impulse that had led him to accept Mrs. Conover’s invitation. The
girl had always exerted a subtle charm, a nameless influence, over
him. Years before, when he was struggling, penniless, to make a
living in a city where his family name opened every door to him, yet
where it was more of an impediment than otherwise in his task of
bread winning; even then he had worked with a vague, half-formed
hope of Anice Lanier sharing his final victory.
Then had come her own financial reverses, her father’s death, and
her withdrawal from the world that had known them both. Since that
time circumstances had checked their growing intimacy. It was
pleasant to Standish to feel that that intimacy and understanding
were now renewed almost just where they had left off. His battle for
livelihood and success had beaten from him much of the buoyancy
that had once been his charm. Anice seemed the one link connecting
him with Youth—the link whereby he might one day win his way
back to that dear lost country of his boyish hopes and dreams. It
would be good to forget, with her, the dreary uphill struggle that was
so bitter and youth-sapping when endured alone. Then he laughed
grimly at his own silly fantasy, and came back to every-day self-
control.
The rooms were clearing. Clive got to his feet and followed the
general drift toward the enormous ball-room in the rear of the
mansion that had for the occasion been converted into a banquet
hall.
On the way he encountered a long, lean, pasty-faced young man
who hailed him with a weary:
“Hello, Standish! Didn’t expect to see you here. Beastly bore, isn’t
it? And the governor dragged me all the way from New York to show
up at it.”
“You spend most of your time in New York nowadays, don’t you,
Jerry?” said Clive.
“Say, old chap,” protested young Conover, “cut out the ‘Jerry,’ can’t
you? My Christian name’s Gerald. ‘Jerry’ was all right enough when I
was a kid in this one-horse provincial hole. But it would swamp a
man of my standing in New York.”
Clive had a fair idea of the “standing” in question. A half-baked
lad, turned out of Harvard after two years of futile loafing, sent on a
trip around the world (that culminated in a delightfully misspent
year in Paris), at last coming home with a well-grounded contempt
for his native city, and turned loose at his own request on long-
suffering New York, with more money than belonged to him and
fewer brains than sufficed to keep it. This in a nutshell was the
history—so far as the world at large knew—of Caleb Conover’s only
son.
From time to time newspaper accounts of beaten cabmen, suppers
that ended in police stations, and similar feats of youthful gayety and
culture had floated to Granite. Yet Caleb Conover, otherwise so rigid
in the matter of appearances, read such accounts with relish, and
boasted loudly of the swath his son was cutting in Gotham society.
For, on Gerald’s word, Conover was firmly assured that this was the
true career of a young man of fashion. It represented all he had
missed in his own poverty-fighting early manhood, and he rejoiced in
his son’s good times.
Getting rid of Gerald as soon as he decently might, Standish made
his way to the supper-room. At a hundred tables sat more or less
bored guests. Waiters swirled wildly to and fro. In a balcony above
blared an orchestra. At the doors and in a fringe about the edges of
the room were grouped the Conover political and business hangers
on. The place was hot to suffocation and heavy with the scent of
flowers.
Suddenly, through the volume of looser sound, came a succession
of sharp raps. The orchestra stopped short. The guests ceased
speaking, and craned their necks.
At the far end of the room, under a gaudy floral piece, a man had
risen to his feet.
“Speech!” yelled Shevlin, enthusiastically, from a doorway. Then,
made aware of his breach of etiquette by a swift but awful glance
from his chief, he wilted behind a palm.
But Shevlin had read the signs aright.
Caleb Conover, Railroader, was about to make a speech.
CHAPTER II
CALEB CONOVER MAKES A SPEECH

Conover had broken, that night, two rules that had for years
formed inviolate tenets of his life creed. In the first place, he—whose
battles had for the most part been won by the cold eye that told
nothing, and by the colder brain that dictated the words of his every-
day speech as calculatingly as a diplomat dictates a letter of state—he
had forced himself to throw away his guard and to chatter and make
himself agreeable like any bargain counter clerk. The effort had been
irksome.
In the second, he had departed from his fixed habit of total
abstinence. The love of strong drink ran high in his blood. Early in
life he had decided that such indulgence would militate against
success. So he had avoided even the mildest potations from
thenceforward. To-night (his usually stolid nerves tense with the
excitement of the grand cast he was making for “social recognition”)
he had felt, as never before in campaign or in business climax, the
need for stimulant to enable him to play his awkward rôle. Moreover
—he had his son, Gerald’s, high authority for the statement—total
abstinence was no longer in vogue among the elect.
As soon, therefore, as he had taken his seat in the supper-room he
had braced himself by a glass of champagne. The unwonted beverage
sent a delicious glow through him. His puzzled brain cleared, his last
doubts of the entertainment’s success began to fade.
An obsequious waiter at his elbow hastened to refill the glass, and
Conover, his eyes darting hither and thither among the guests to
single out and dwell on the various faces he had so long and so vainly
yearned to see in his house, absent-mindedly emptied it and another
after it. He was talking assiduously to Mrs. Van Alstyne, whom at
first he had found somewhat frigid and difficult; but who, he now
discovered to his surprise, it was growing momentarily easier to
entertain. He had had no idea of his own command of language.
Supper was still in its early stages when a fourth glass of heady
vintage champagne followed the other three. From doorways and
walls his political followers looked on with amaze. To them the sight
of the Boss drinking was the eighth wonder of the world. They
nudged each other and muttered awed comments out of the corners
of their mouths.
But Caleb heeded this not at all. He was happy. Very happy. The
party over which he had suffered such secret qualms and to secure
the desired guests for which he had strained every atom of his vast
political and business influence, was proving a marvellous success.
At last he was in society. And he had thought the barriers of that
Body so impassable! He was in society. At last. And talking with
delightful, brilliant fluency with one of its acknowledged leaders. He
had conquered.
The waiter filled his glass for the fifth time. After all, champagne
had an effect whiskey could never equal. The fifth draught (for he
allowed but one swallow to the goblet) seemed to inspire him even
more than had its predecessors.
Then it was that fifty generations of Irishmen who, under the spell
of liquor, acquired a flow of language not their own, clamored for
voice in this their latest and greatest descendant. Now that he was in
so foreign, brilliant a mood, what more apt than a graceful little
speech of greeting to those his fellow-townsmen who had flocked
thither to do him honor? The idea was sublime. Conover rose to his
feet and rapped for silence. He would speak while the gift of
eloquence was still strong upon him.
“Ladies and gentlemen,” began Caleb, clearing his voice and
looking down the great room across the concourse of wondering,
amused, or expectant faces that gently swayed in a faint haze before
his eyes, “I guess you all know, without my telling you, how glad I am
to see you here to-night, and I want you should enjoy every minute of
your evening. Some of you are old friends of mine. There’s more’n a
few here to-night that remembers me when I was barefooted Cale
Conover, without a dollar to my name nor any very hectic prospects
of getting one.
“But there’s a lot more of you here that I hadn’t the honor of
knowing then, nor for that matter of meeting at all till to-night. It’s to
these, mostly, that I’m talking now. For I want ’em to know me better
and like me better. Maybe if they hear more about me they will.
That’s why I’m on my feet now.
“I b’lieve it isn’t customary to make a speech any more at parties.
But you’ll have to forgive me. I’m not much onto the latest frills and
fashions. But give me a chance, and I’ll learn as easy as a Chinaman.
It came to me all of a sudden to say what I’ve got to say, right here
and now, even if it’s at the expense of a little etiquette. I’ve asked you
here to-night, mainly, of course, for the pleasure of entertaining you,
and I hope you’re all having a real good time. But I had another
reason, too.”
The men at the tables looked perplexed. Was this the Caleb
Conover they had met and cringed to in the outer world, this
garrulous, rambling man with the flushed face?
“You see, I’ve come to be a kind of a feature of this city of ours and
of the State, too. I’m here to stay. And I want that my towns-folks
and my fellow-residents of the Mountain State should know me.
Many of ’em do. There’s a full half-million folks in this city and State
that know all about Caleb Conover. They know he’s on the square,
that he’ll look after their interests, that he’s a white man. They know
he’s a man they can trust in their public life and welcome in their
homes. And, as I said, there’s a lot of these people here to-night.
“But there’s a lot of other folks here who only know me by what
slander and jokes they’ve picked up around town or in the out-of-
State newspapers. It’s these latter folks I’m talking to now. I want
them to know the real me; not the uneducated crook and illiterate
feller my p’litical enemies have made me out. They can’t think I’m all
bad, or they wouldn’t be my guests. Would they, now? And a little
frankness ought to do the rest.
“Some people say I’ve risen from the gutter. Well, I’ve risen from
it, haven’t I? A lot of men on Pompton Avenue and in the big clubs
are just where they started when they were born. Not a step in
advance of where their fathers left ’em. Swell chance they’d have had
if their parents had started ’em in the gutter as mine did, wouldn’t
they? Where’d they be now?
“What does the start amount to? The finish line’s where the score’s
counted. Gutter or palace.
“‘A man’s a man for a’ that,’ says a poet by the name of R. Burns.
And he was right, even if he did waste his time on verse-stringing.
Only it always seemed a pity to me those words wasn’t said by
someone bigger’n a measly poet. Someone whose name carried
weight, and whose words would be quoted more. Because then more
folks might hear of it and believe it. I don’t suppose one person in
fifty’s ever heard of this R. Burns person. (I never did, myself, till I
bought a Famous Quotation book to use in one of my campaigns.
That’s how I got familiar with the writings of R. Burns and Ibid and
Byron and all those rhymer people.) Now, if some public character
like Tom Platt, or Matt Quay, or someone else that everybody’s heard
of, had said that quotation about a man being a man——”
Caleb paused to gather up the loose threads of his discourse. This
caused him a moment of dull bewilderment, for he was not
accustomed to digress, either in mind or talk, and the phenomenon
puzzled him. He rallied and went on:
“But that isn’t the point. I was telling you about myself. I started in
the gutter, just as the ‘knockers’ say I did. Or down by the freight
yards, and that’s about the same thing. My mother took in washing—
when she could get it. My father went to the penitentiary for freight-
lifting when I was ten—he was a stevedore—and he died there. I was
brought up on a street where the feller—man or boy—who couldn’t
fight had to stay indoors. And indoors was one place I never stayed. I
began as coal boy in the C. G. & X. elevators; then I got a job firing on
a fast freight, and from that I took to braking on a local passenger
run. Then I was yardmaster, and then in the sup’rintendent’s office,
and then came the job of sup’rintendent and after that general
manager, and I worked my way up till I ran the C. G. & X. road
single-handed. Meantime I was looking after your city’s interests.
Three times as Alderman and then once as Mayor, for the boys knew
they could bank on me. I got hold of interests here and interests
there. Cheap, run-down interests they were, for the most part, but I
built ’em up. Take the C. G. & X., for instance. Biggest road in the
State to-day. How’d it get so? I made it. It was all run down, and on
its last legs when I took hold. I acquired it and——”
He paused once more, fighting back that queer tendency to let slip
his grasp on his subject.
“I remember that C. G. & X. deal,” whispered Greer to his wife. “He
juggled shares and pulled wires and spread calamity rumors till he
was able to smash the stock down to a dollar-ten per. He scared out
all the other big holders, gobbled their stock, reorganized, and
reaped a clean five million on the deal.”
“Hush!” retorted Mrs. Greer. “This is too rich to miss. I must
remember it all, to——”
“—So, you see,” Caleb was continuing, “I fought my way up. Every
move was a fight, and every fight was a win. That’s my motto. Fight
to win. An’ if you don’t win, let it be your executor, not you, that
knows you lost. But the biggest fight of all was to come. I controlled
the city. I helped control the State. I had all the money any man
needed, and I was spending it right here in the town where it was
earned. I was a successful man. But the man who’s satisfied with
success would be satisfied with failure. And I wasn’t satisfied.
“There was still one thing I couldn’t get. I couldn’t get one set of
people to recognize me when they met me in the street, to ask me to
their houses, to come to my house. Why? I don’t know. Maybe they
don’t know. Maybe they didn’t want to know. There’s a lot of things
society folks don’t seem to want to know. And one of those things
was me. I couldn’t win ’em over. I built this house. Cost $200,000
more’n any other house in town. If you doubt it, step down to the
Building Commissioner’s and look over the specifications. Built it on
the most fash’nable avenue, too. But still society wouldn’t say:
‘Pleased to know you!’ ‘Maybe it’s my lack of blue blood,’ thinks I.
‘Though my pile’s been made a good deal cleaner than many an
aristocrat’s.’ I married a lady of the first families here”—a ripple of
unintelligible surprise broke in on his ears, but quickly died. “What
was the result? She was asked out and I wasn’t. But I kept on
fighting. And at last I’m in the winning stride.
“I’m not a college man myself. All my education’s hand-made and
since I was thirty. But I was bound my son should be one. And he is.
He’s in society, too. The best New York affords, I’m told. My girl’s
had advantages, too, and you see the result. Do unto others what you
can’t do for yourself. That’s worth remembering sometimes. And
now at last I get my comeback for all my outlay.

You might also like