100% found this document useful (6 votes)
77 views62 pages

Get Sams Teach Yourself HTML CSS and JavaScript All in One 1st Edition Meloni Julie C PDF Ebook With Full Chapters Now

HTML

Uploaded by

peadennovy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (6 votes)
77 views62 pages

Get Sams Teach Yourself HTML CSS and JavaScript All in One 1st Edition Meloni Julie C PDF Ebook With Full Chapters Now

HTML

Uploaded by

peadennovy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 62

Download the full version of the textbook now at textbookfull.

com

Sams Teach Yourself HTML CSS and JavaScript


All in One 1st Edition Meloni Julie C

https://textbookfull.com/product/sams-teach-
yourself-html-css-and-javascript-all-in-one-1st-
edition-meloni-julie-c/

Explore and download more textbook at https://textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Sams Teach Yourself HTML CSS and JavaScript All in One 1st
Edition Meloni Julie C

https://textbookfull.com/product/sams-teach-yourself-html-css-and-
javascript-all-in-one-1st-edition-meloni-julie-c/

textbookfull.com

Sams Teach Yourself C in 24 Hours 6th Ed 6th Edition


Rogers Cadenhead

https://textbookfull.com/product/sams-teach-yourself-c-
in-24-hours-6th-ed-6th-edition-rogers-cadenhead/

textbookfull.com

Sams Teach yourself Java in 24 Hours [8th Ed] 8th Edition


Rogers Cadenhead

https://textbookfull.com/product/sams-teach-yourself-java-
in-24-hours-8th-ed-8th-edition-rogers-cadenhead/

textbookfull.com

Image guided interventions 2nd Edition M. A. Mauro

https://textbookfull.com/product/image-guided-interventions-2nd-
edition-m-a-mauro/

textbookfull.com
Reviews of Environmental Contamination and Toxicology
Volume 238 1st Edition Pim De Voogt (Eds.)

https://textbookfull.com/product/reviews-of-environmental-
contamination-and-toxicology-volume-238-1st-edition-pim-de-voogt-eds/

textbookfull.com

Magdalene poems First Edition Howe

https://textbookfull.com/product/magdalene-poems-first-edition-howe/

textbookfull.com

Emerald Blaze Hidden Legacy 05 2nd Edition Ilona Andrews

https://textbookfull.com/product/emerald-blaze-hidden-legacy-05-2nd-
edition-ilona-andrews/

textbookfull.com

The Handbook of Groundwater Engineering 3rd Edition John


H. Cushman

https://textbookfull.com/product/the-handbook-of-groundwater-
engineering-3rd-edition-john-h-cushman/

textbookfull.com

The Game Console A Photographic History from Atari to Xbox


1st Edition Evan Amos

https://textbookfull.com/product/the-game-console-a-photographic-
history-from-atari-to-xbox-1st-edition-evan-amos-2/

textbookfull.com
Tropospheric Ozone and its Impacts on Crop Plants A Threat
to Future Global Food Security 1st Edition Supriya Tiwari

https://textbookfull.com/product/tropospheric-ozone-and-its-impacts-
on-crop-plants-a-threat-to-future-global-food-security-1st-edition-
supriya-tiwari/
textbookfull.com
Julie C. Meloni

Sams Teach Yourself

HTML, CSS
and JavaScript

All
One
in

800 East 96th Street, Indianapolis, Indiana, 46240 USA


Sams Teach Yourself HTML, CSS, and JavaScript All in One Acquisitions Editor
Mark Taber
Copyright © 2012 by Pearson Education, Inc.
All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, Development Editor
or transmitted by any means, electronic, mechanical, photocopying, recording, or other- Songlin Qiu
wise, without written permission from the publisher. No patent liability is assumed with
respect to the use of the information contained herein. Although every precaution has Managing Editor
been taken in the preparation of this book, the publisher and author assume no responsi- Sandra Schroeder
bility for errors or omissions. Nor is any liability assumed for damages resulting from the
use of the information contained herein. Project Editor
ISBN-13: 978-0-672-33332-3 Seth Kerney
ISBN-10: 0-672-33332-5
Copy Editor
Library of Congress Cataloging-in-Publication data is on file.
Mike Henry
First Printing November 2011
Indexer
Trademarks
Ken Johnson
All terms mentioned in this book that are known to be trademarks or service marks have
been appropriately capitalized. Sams Publishing cannot attest to the accuracy of this Proofreader
information. Use of a term in this book should not be regarded as affecting the validity of Jovana San Nicolas-
any trademark or service mark.
Shirley
Warning and Disclaimer Technical Editor
Every effort has been made to make this book as complete and as accurate as possible,
Phil Ballard
but no warranty or fitness is implied. The information provided is on an “as is” basis. The
author and the publisher shall have neither liability nor responsibility to any person or Publishing Coordinator
entity with respect to any loss or damages arising from the information contained in this
Cindy Teeters
book or programs accompanying it.
Book Designer
Bulk Sales
Gary Adair
Sams Publishing offers excellent discounts on this book when ordered in quantity for bulk
purchases or special sales. For more information, please contact Compositor
U.S. Corporate and Government Sales Trina Wurst
1-800-382-3419
[email protected]
For sales outside of the U.S., please contact
International Sales
[email protected]
Contents at a Glance PART V: Advanced JavaScript
Programming
PART I: Getting Started on the Web CHAPTER 21: Using Unobtrusive JavaScript
CHAPTER 1: Publishing Web Content CHAPTER 22: Using Third-Party Libraries
CHAPTER 2: Understanding HTML and XHTML CHAPTER 23: Greasemonkey: Enhancing the Web
Connections with JavaScript
CHAPTER 3: Understanding Cascading Style CHAPTER 24: AJAX: Remote Scripting
Sheets
PART VI: Advanced Website
CHAPTER 4: Understanding JavaScript
Functionality and Management
PART II: Building Blocks of Practical CHAPTER 25: Creating Print-Friendly Web Pages
Web Design CHAPTER 26: Working with Web-Based Forms
CHAPTER 5: Working with Fonts, Text Blocks, and CHAPTER 27: Organizing and Managing a
Lists Website
CHAPTER 6: Using Tables to Display Information CHAPTER 28: Helping People Find Your Web
CHAPTER 7: Using External and Internal Links Pages
CHAPTER 8: Working with Colors, Images, and Index
Multimedia

PART III: Advanced Web Page Design


with CSS
CHAPTER 9: Working with Margins, Padding,
Alignment, and Floating
CHAPTER 10: Understanding the CSS Box Model
and Positioning
CHAPTER 11: Using CSS to Do More with Lists,
Text, and Navigation
CHAPTER 12: Creating Fixed or Liquid Layouts

PART IV: Getting Started with Dynamic


Web Sites
CHAPTER 13: Understanding Dynamic Websites
CHAPTER 14: Getting Started with JavaScript
Programming
CHAPTER 15: Working with the Document Object
Model (DOM)
CHAPTER 16: Using JavaScript Variables, Strings,
and Arrays
CHAPTER 17: Using JavaScript Functions and
Objects
CHAPTER 18: Controlling Flow with Conditions
and Loops
CHAPTER 19: Responding to Events
CHAPTER 20: Using Windows and Frames
Table of Contents CHAPTER 5: Working with Fonts, Text Blocks,
and Lists 81
CHAPTER 1: Publishing Web Content 1 Boldface, Italics, and Special Text Formatting . . . . 82
A Brief History of HTML and the World Tweaking the Font . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Wide Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Working with Special Characters . . . . . . . . . . . . . . . . . . . . 89
Creating Web Content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Aligning Text on a Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Understanding Web Content Delivery . . . . . . . . . . . . . . . . 3 The Three Types of HTML Lists . . . . . . . . . . . . . . . . . . . . . . 95
Selecting a Web Hosting Provider . . . . . . . . . . . . . . . . . . . . 6 Placing Lists Within Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Testing with Multiple Web Browsers . . . . . . . . . . . . . . . . . . 8
CHAPTER 6: Using Tables to Display
Creating a Sample File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Information 107
Using FTP to Transfer Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Creating a Simple Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Distributing Content Without a Web Server . . . . . . 18 Controlling Table Sizes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Tips for Testing Web Content . . . . . . . . . . . . . . . . . . . . . . . . 19 Alignment and Spanning Within Tables . . . . . . . . . . 113
CHAPTER 2: Understanding HTML and Page Layout with Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
XHTML Connections 25
CHAPTER 7: Using External and Internal
Getting Prepared . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Links 123
Getting Started with a Simple Web Page . . . . . . . . 26 Using Web Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
HTML Tags Every XHTML Web Page Must Have . . 29 Linking Within a Page Using Anchors . . . . . . . . . . . . 126
Organizing a Page with Paragraphs and Line Linking Between Your Own Web Content . . . . . . . . 129
Breaks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Linking to External Web Content . . . . . . . . . . . . . . . . . . 131
Organizing Your Content with Headings . . . . . . . . . . 34
Linking to an Email Address . . . . . . . . . . . . . . . . . . . . . . . . 132
Validating Your Web Content . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Opening a Link in a New Browser Window . . . . 134
The Scoop on HTML, XML, XHTML, and HTML5 . . 38
Using CSS to Style Hyperlinks . . . . . . . . . . . . . . . . . . . . 134
CHAPTER 3: Understanding Cascading Style
Sheets 45 CHAPTER 8: Working with Colors,
Images, and Multimedia 141
How CSS Works . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Best Practices for Choosing Colors . . . . . . . . . . . . . . 141
A Basic Style Sheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Understanding Web Colors . . . . . . . . . . . . . . . . . . . . . . . . . . 143
A CSS Style Primer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Using Hexadecimal Values for Colors . . . . . . . . . . . . 145
Using Style Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Using CSS to Set Background, Text, and
Using Style IDs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Border Colors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Internal Style Sheets and Inline Styles . . . . . . . . . . . . 59 Choosing Graphics Software . . . . . . . . . . . . . . . . . . . . . . . . 148
CHAPTER 4: Understanding JavaScript 65 The Least You Need to Know About Graphics . . 149
Learning Web Scripting Basics . . . . . . . . . . . . . . . . . . . . . . 65 Preparing Photographic Images . . . . . . . . . . . . . . . . . . . . 150
How JavaScript Fits into a Web Page . . . . . . . . . . . . . . 67 Creating Banners and Buttons . . . . . . . . . . . . . . . . . . . . 155
Exploring JavaScript’s Capabilities . . . . . . . . . . . . . . . . . . 70 Reducing the Number of Colors in an Image. . . . 157
Displaying Time with JavaScript. . . . . . . . . . . . . . . . . . . . . . 71 Working with Transparent Images . . . . . . . . . . . . . . . . 158
Beginning the Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 Creating Tiled Backgrounds . . . . . . . . . . . . . . . . . . . . . . . . 159
Adding JavaScript Statements . . . . . . . . . . . . . . . . . . . . . . 72 Creating Animated Web Graphics . . . . . . . . . . . . . . . . 160
Creating Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 Placing Images on a Web Page . . . . . . . . . . . . . . . . . . . . 161
Adding the Script to a Web Page . . . . . . . . . . . . . . . . . . . . 73 Describing Images with Text . . . . . . . . . . . . . . . . . . . . . . . . 163
Testing the Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 Specifying Image Height and Width . . . . . . . . . . . . . . 165
Aligning Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Turning Images into Links . . . . . . . . . . . . . . . . . . . . . . . . . . 169 CHAPTER 14: Getting Started with JavaScript
Using Background Images . . . . . . . . . . . . . . . . . . . . . . . . . . 171 Programming 287
Using Imagemaps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173 Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
Integrating Multimedia into Your Website . . . . . . 178 JavaScript Syntax Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
Using Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
CHAPTER 9: Working with Margins, Padding, Best Practices for JavaScript . . . . . . . . . . . . . . . . . . . . . . 293
Alignment, and Floating 191
Using Margins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192 CHAPTER 15: Working with the Document
Padding Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199 Object Model (DOM) 299
Keeping Everything Aligned . . . . . . . . . . . . . . . . . . . . . . . . . . 203 Understanding the Document Object
Model (DOM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
Understanding the Float Property . . . . . . . . . . . . . . . . 204
Using window Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300
CHAPTER 10: Understanding the CSS Box Working with the document Object. . . . . . . . . . . . . . . . 300
Model and Positioning 209 Accessing Browser History . . . . . . . . . . . . . . . . . . . . . . . . . . 303
The CSS Box Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209 Working with the location Object . . . . . . . . . . . . . . . . . . 305
The Whole Scoop on Positioning . . . . . . . . . . . . . . . . . . 213 More About the DOM Structure . . . . . . . . . . . . . . . . . . . . 306
Controlling the Way Things Stack Up . . . . . . . . . . . . 217 Working with DOM Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
Managing the Flow of Text . . . . . . . . . . . . . . . . . . . . . . . . . . 220 Creating Positionable Elements (Layers) . . . . . . . . 311
Hiding and Showing Objects . . . . . . . . . . . . . . . . . . . . . . . . 316
CHAPTER 11: Using CSS to Do More with
Lists, Text, and Navigation 225 Modifying Text Within a Page . . . . . . . . . . . . . . . . . . . . . . 317
HTML List Refresher . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226 Adding Text to a Page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
How the CSS Box Model Affects Lists . . . . . . . . . . 226
CHAPTER 16: Using JavaScript Variables,
Placing List Item Indicators . . . . . . . . . . . . . . . . . . . . . . . . 229 Strings, and Arrays 325
Creating Image Maps with List Items and Using Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
CSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
Understanding Expressions and Operators . . . . 328
How Navigation Lists Differ from Regular
Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235 Data Types in JavaScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
Creating Vertical Navigation with CSS . . . . . . . . . . 236 Converting Between Data Types . . . . . . . . . . . . . . . . . . 331
Creating Horizontal Navigation with CSS . . . . . . . . 245 Using String Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
Working with Substrings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
CHAPTER 12: Creating Fixed or Liquid Using Numeric Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
Layouts 253 Using String Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
Understanding Fixed Layouts . . . . . . . . . . . . . . . . . . . . . . 254 Sorting a Numeric Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340
Understanding Liquid Layouts . . . . . . . . . . . . . . . . . . . . . . 255
Creating a Fixed/Liquid Hybrid Layout . . . . . . . . . . 258 CHAPTER 17: Using JavaScript Functions
and Objects 347
CHAPTER 13: Understanding Dynamic Using Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
Websites 273 Introducing Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
Understanding the Different Types of Scripting273 Using Objects to Simplify Scripting . . . . . . . . . . . . . . 354
Including JavaScript in HTML . . . . . . . . . . . . . . . . . . . . . . 274 Extending Built-in Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
Displaying Random Content . . . . . . . . . . . . . . . . . . . . . . . . 276 Using the Math Object . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
Understanding the Document Object Model . . 280 Working with Math Functions . . . . . . . . . . . . . . . . . . . . . . 361
Changing Images Based on User Interaction . . 281 Using the with Keyword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
Working with Dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
CHAPTER 18: Controlling Flow with CHAPTER 24: AJAX: Remote Scripting 479
Conditions and Loops 369 Introducing AJAX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
The if Statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369 Using XMLHttpRequest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483
Using Shorthand Conditional Expressions. . . . . . 372 Creating a Simple AJAX Library . . . . . . . . . . . . . . . . . . . . 485
Testing Multiple Conditions with if and else . . 373 Creating an AJAX Quiz Using the Library . . . . . . . . 487
Using Multiple Conditions with switch . . . . . . . . . . 375 Debugging AJAX Applications . . . . . . . . . . . . . . . . . . . . . . 491
Using for Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
Using while Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379 CHAPTER 25: Creating Print-Friendly
Web Pages 499
Using do...while Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
What Makes a Page Print-Friendly? . . . . . . . . . . . . . . 500
Working with Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 380
Applying a Media-Specific Style Sheet . . . . . . . . . . 503
Looping Through Object Properties . . . . . . . . . . . . . . 382
Designing a Style Sheet for Print Pages . . . . . . . . 505
CHAPTER 19: Responding to Events 389 Viewing a Web Page in Print Preview . . . . . . . . . . . . 508
Understanding Event Handlers . . . . . . . . . . . . . . . . . . . . 389
CHAPTER 26: Working with Web-Based
Using Mouse Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
Forms 513
Using Keyboard Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
How HTML Forms Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
Using the onLoad and onUnload Events . . . . . . . . 399
Creating a Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
Using onclick to Change <div> Appearance. . . . 400
Accepting Text Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
CHAPTER 20: Using Windows and Frames 409 Naming Each Piece of Form Data . . . . . . . . . . . . . . . . 519
Controlling Windows with Objects . . . . . . . . . . . . . . . . 409 Exploring Form Input Controls . . . . . . . . . . . . . . . . . . . . . . 521
Moving and Resizing Windows . . . . . . . . . . . . . . . . . . . . 413 Submitting Form Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
Using Timeouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414 Accessing Form Elements with JavaScript . . . . . . 528
Displaying Dialog Boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417 Displaying Data from a Form . . . . . . . . . . . . . . . . . . . . . . 528
Working with Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418 Sending Form Results by Email . . . . . . . . . . . . . . . . . . . . 530
Building a Frameset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
CHAPTER 27: Organizing and Managing
Linking Between Frames and Windows . . . . . . . . . . 423 a Website 537
Using Inline Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 426 When One Page Is Enough . . . . . . . . . . . . . . . . . . . . . . . . . . 538
CHAPTER 21: Using Unobtrusive Organizing a Simple Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540
JavaScript 433 Organizing a Larger Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543
Scripting Best Practices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433 Writing Maintainable Code . . . . . . . . . . . . . . . . . . . . . . . . . . 546
Reading Browser Information . . . . . . . . . . . . . . . . . . . . . . 440 Thinking About Version Control . . . . . . . . . . . . . . . . . . . . 548
Cross-Browser Scripting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
CHAPTER 28: Helping People Find Your
Supporting Non-JavaScript Browsers . . . . . . . . . . . . 445 Web Pages 553
CHAPTER 22: Using Third-Party Libraries 453 Publicizing Your Website. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553
Using Third-Party Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . 453 Listing Your Pages with the Major
Search Sites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 555
Other Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456
Providing Hints for Search Engines . . . . . . . . . . . . . . 556
CHAPTER 23: Greasemonkey: Enhancing Additional Tips for Search Engine
the Web with JavaScript 463 Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562
Introducing Greasemonkey . . . . . . . . . . . . . . . . . . . . . . . . . . 463 INDEX 567
Working with User Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . 466
Creating Your Own User Scripts. . . . . . . . . . . . . . . . . . . . 468
About the Author
Julie C. Meloni is the Lead Technologist and Architect in the Online Library Environment at the
University of Virginia. Before coming to the library, she worked for more than 15 years in web appli-
cation development for various corporations large and small in Silicon Valley. She has written sev-
eral books and articles on Web-based programming languages and database topics, including the
bestselling Sams Teach Yourself PHP, MySQL, and Apache All in One.
We Want to Hear from You!
As the reader of this book, you are our most important critic and commentator. We value your opin-
ion and want to know what we’re doing right, what we could do better, what areas you’d like to see
us publish in, and any other words of wisdom you’re willing to pass our way.
You can email or write directly to let us know what you did or didn’t like about this book—as well
as what we can do to make our books stronger.
Please note that we cannot help you with technical problems related to the topic of this book, and
that due to the high volume of mail we receive, we might not be able to reply to every message.
When you write, please be sure to include this book’s title and author as well as your name and
email address. We will carefully review your comments and share them with the author and editors
who worked on the book.
Email: feedback@samspublishing
Mail: Sams Publishing
800 East 96th Street
Indianapolis, IN 46240 USA

Reader Services
Visit our website and register this book at informit.com/register for convenient access to any
updates, downloads, or errata that might be available for this book.
CHAPTER 1
Publishing Web Content

Before learning the intricacies of HTML (Hypertext Markup Language), WHAT YOU’LL LEARN IN
CSS (Cascading Style Sheets), and JavaScript, it is important that you gain THIS CHAPTER:
a solid understanding of the technologies that help transform these plain- . A very brief history of the
text files to the rich multimedia displays you see on your computer or World Wide Web
handheld device when browsing the World Wide Web. For example, a file . What is meant by the term
containing markup and client-side code HTML and CSS is useless without web page, and why that
term doesn’t always reflect
a web browser to view it, and no one besides yourself will see your content all the content involved
unless a web server is involved. Web servers make your content available
. How content gets from your
to others who, in turn, use their web browsers to navigate to an address personal computer to some-
and wait for the server to send information to them. You will be intimately one else’s web browser
involved in this publishing process because you must create files and then . How to select a web host-
put them on a server to make them available in the first place, and you ing provider
must ensure that your content will appear to the end user as you intended. . How different web
browsers and device types
can affect your content
A Brief History of HTML and the . How to transfer files to
your web server using FTP
World Wide Web . Where files should be
placed on a web server
Once upon a time, back when there weren’t any footprints on the moon,
. How to distribute web con-
some farsighted folks decided to see whether they could connect several tent without a web server
major computer networks together. I’ll spare you the names and stories . How to use other publish-
(there are plenty of both), but the eventual result was the “mother of all ing methods such as blogs
networks,” which we call the Internet. . Tips for testing the appear-
ance and functionality of
Until 1990, accessing information through the Internet was a rather techni- web content.
cal affair. It was so hard, in fact, that even Ph.D.-holding physicists were
often frustrated when trying to swap data. One such physicist, the now-
famous (and knighted) Sir Tim Berners-Lee, cooked up a way to easily
cross-reference text on the Internet through hypertext links.
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
2 CHAPTER 1 Publishing Web Content

NOTE This wasn’t a new idea, but his simple HTML managed to thrive while
For more information about the more ambitious hypertext projects floundered. Hypertext originally meant
history of the World Wide Web, text stored in electronic form with cross-reference links between pages. It is
see the Wikipedia article on now a broader term that refers to just about any object (text, images, files,
this topic: http://en.wikipedia.
and so on) that can be linked to other objects. Hypertext Markup Language is
org/wiki/History_of_the_Web.
a language for describing how text, graphics, and files containing other
information are organized and linked together.

By 1993, only 100 or so computers throughout the world were equipped to


serve up HTML pages. Those interlinked pages were dubbed the World
Wide Web (WWW), and several web browser programs had been written to
allow people to view web pages. Because of the growing popularity of the
Web, a few programmers soon wrote web browsers that could view graph-
ical images along with text. From that point forward, the continued devel-
opment of web browser software and the standardization of the HTML—
and XHTML—languages has lead us to the world we live in today, one in
which more than 110 million web servers answer requests for more than 25
billion text and multimedia files.

These few paragraphs really are a brief history of what has been a remark-
able period. Today’s college freshmen have never known a time in which
the Web didn’t exist, and the idea of always-on information and ubiquitous
computing will shape all aspects of our lives moving forward. Instead of
seeing web content creation and management as a set of skills possessed
only by a few technically oriented folks (okay, call them geeks if you will),
by the end of this book, you will see that these are skills that anyone can
master, regardless of inherent geekiness.

Creating Web Content


You might have noticed the use of the term web content rather than web
pages—that was intentional. Although we talk of “visiting a web page,”
what we really mean is something like “looking at all the text and the
images at one address on our computer.” The text that we read, and the
images that we see, are rendered by our web browsers, which are given
certain instructions found in individual files.

Those files contain text that is marked up, or surrounded by, HTML codes
that tell the browser how to display the text—as a heading, as a paragraph,
in a red font, and so on. Some HTML markup tells the browser to display
Understanding Web Content Delivery 3

an image or video file rather than plain text, which brings me back to the
point: Different types of content are sent to your web browser, so simply
saying web page doesn’t begin to cover it. Here we use the term web content
instead, to cover the full range of text, image, audio, video, and other
media found online.

In later chapters, you will learn the basics of linking to or creating the vari-
ous types of multimedia web content found in websites. All you need to
remember at this point is that you are in control of the content a user sees
when visiting your website. Beginning with the file that contains text to
display or codes that tell the server to send a graphic along to the user’s
web browser, you have to plan, design, and implement all the pieces that
will eventually make up your web presence. As you will learn throughout
this book, it is not a difficult process as long as you understand all the little
steps along the way.

In its most fundamental form, web content begins with a simple text file
containing HTML or XHTML markup. XHTML is another flavor of HTML;
the “X” stands for eXtensible, and you will learn more about it as you con-
tinue through the chapters. The most important thing to know from the
outset is that all the examples in this book are HTML 4 and XHTML com-
patible, meaning that they will be rendered similarly both now and in the
future by any newer generations of web browsers. That is one of the bene-
fits of writing standards-compliant code: You do not have to worry about
going back to your code sometime in the future and changing it because it
doesn’t work. Your code will likely always work for as long as web
browsers adhere to standards (hopefully a long time).

Understanding Web Content


Delivery
Several processes occur, in many different locations, to eventually produce
web content that you can see. These processes occur very quickly—on the
order of milliseconds—and occur behind the scenes. In other words,
although we might think all we are doing is opening a web browser, typ-
ing in a web address, and instantaneously seeing the content we requested,
technology in the background is working hard on our behalf. Figure 1.1
shows the basic interaction between a browser and a server.
4 CHAPTER 1 Publishing Web Content

FIGURE 1.1
A browser request and a server
response.

However, there are several steps in the process—and potentially several


trips between the browser and server—before you see the entire content of
the site you requested.

Suppose you want to do a Google search, so you dutifully type


http://www.google.com in the address bar or select the Google bookmark
from your bookmarks list. Almost immediately, your browser will show
you something like what’s shown in Figure 1.2.

FIGURE 1.2
Visiting www.google.com.

Figure 1.2 shows a website that contains text plus one image (the Google
logo). A simple version of the processes that occurred to retrieve that text
and image from a web server and display it on your screen is as follows:
1. Your web browser sends a request for the index.html file located at
the http://www.google.com/ address. The index.html file does not
have to be part of the address that you type in the address bar; you’ll
learn more about the index.html file further along in this chapter.
Understanding Web Content Delivery 5

2. After receiving the request for a specific file, the web server process
looks in its directory contents for the specific file, opens it, and sends
the content of that file back to your web browser.
3. The web browser receives the content of the index.html file, which is
text marked up with HTML codes, and renders the content based on
these HTML codes. While rendering the content, the browser hap-
pens upon the HTML code for the Google logo, which you can see in
Figure 1.2. The HTML code looks like this:
<img src=”/logos/logo.gif” width=”384” height=”121” border=”0”
alt=”Google”/>

The tag provides attributes that tell the browser the file source loca-
tion (src), width (width), height (height), border type (border), and
alternative text (alt) necessary to display the logo. You will learn
more about attributes throughout later chapters.
4. The browser looks at the src attribute in the <img/> tag to find the
source location. In this case, the image logo.gif can be found in the
logos directory at the same web address (www.google.com) from
which the browser retrieved the HTML file.
5. The browser requests the file at the
http://www.google.com/logos/logo.gif web address.
6. The web server interprets that request, finds the file, and sends the
contents of that file to the web browser that requested it.
7. The web browser displays the image on your monitor.

As you can see in the description of the web content delivery process, web
browsers do more than simply act as picture frames through which you
can view content. Browsers assemble the web content components and
arrange those parts according to the HTML commands in the file.

You can also view web content locally, or on your own hard drive, without
the need for a web server. The process of content retrieval and display is
the same as the process listed in the previous steps in that a browser looks
for and interprets the codes and content of an HTML file, but the trip is
shorter; the browser looks for files on your own computer’s hard drive
rather than on a remote machine. A web server is needed to interpret any
server-based programming language embedded in the files, but that is out-
side the scope of this book. In fact, you could work through all the chap-
ters in this book without having a web server to call your own, but then
nobody but you could view your masterpieces.
6 CHAPTER 1 Publishing Web Content

Selecting a Web Hosting Provider


Despite just telling you that you can work through all the chapters in this
book without having a web server, having a web server is the recommend-
ed method for continuing on. Don’t worry—obtaining a hosting provider
is usually a quick, painless, and relatively inexpensive process. In fact, you
can get your own domain name and a year of web hosting for just slightly
more than the cost of the book you are reading now.

If you type web hosting provider in your search engine of choice, you will
get millions of hits and an endless list of sponsored search results (also
known as ads). There are not this many web hosting providers in the
world, although it might seem like there are. Even if you are looking at a
managed list of hosting providers, it can be overwhelming—especially if
all you are looking for is a place to host a simple website for yourself or
your company or organization.

You’ll want to narrow your search when looking for a provider and choose
one that best meets your needs. Some selection criteria for a web hosting
provider include the following”
. Reliability/server “uptime”—If you have an online presence, you
want to make sure people can actually get there consistently.
. Customer service—Look for multiple methods for contacting cus-
tomer service (phone, email, and chat) as well as online documenta-
tion for common issues.
. Server space—Does the hosting package include enough server
space to hold all the multimedia files (images, audio, and video) you
plan to include in your website (if any)?
. Bandwidth—Does the hosting package include enough bandwidth
so that all the people visiting your site and downloading files can do
so without you having to pay extra?
. Domain name purchase and management—Does the package
include a custom domain name, or must you purchase and maintain
your domain name separately from your hosting account?
. Price—Do not overpay for hosting. You will see a wide range of prices
offered and should immediately wonder “what’s the difference?”
Often the difference has little to do with the quality of the service and
everything to do with company overhead and what the company
thinks they can get away with charging people. A good rule of thumb
is that if you are paying more than $75 per year for a basic hosting
package and domain name, you are probably paying too much.
Selecting a Web Hosting Provider 7

Here are three reliable web hosting providers whose basic packages con- NOTE
tain plenty of server space and bandwidth (as well as domain names and I have used all these providers
extra benefits) at a relatively low cost. If you don’t go with any of these (and then some) over the years
web hosting providers, you can at least use their basic package descrip- and have no problem recom-
mending any of them; predomi-
tions as a guideline as you shop around. nantly, I use DailyRazor as a
. A Small Orange (http://www.asmallorange.com)—The “Tiny” and web hosting provider, especially
“Small” hosting packages are perfect starting places for the new web for advanced development envi-
ronments.
content publisher.
. DailyRazor (http://www.dailyrazor.com)—Even its Rookie hosting
package is full featured and reliable.
. LunarPages (http://www.lunarpages.com)—The Basic hosting pack-
age is suitable for many personal and small business websites.

One feature of a good hosting provider is that it provides a “control panel”


for you to manage aspects of your account. Figure 1.3 shows the control
panel for my own hosting account at Daily Razor. Many web hosting
providers offer this particular control panel software, or some control
panel that is similar in design—clearly labeled icons leading to tasks you
can perform to configure and manage your account.

FIGURE 1.3
A sample control panel.
8 CHAPTER 1 Publishing Web Content

You might never need to use your control panel, but having it available to
you simplifies the installation of databases and other software, the viewing
of web statistics, and the addition of email addresses (among many other
features). If you can follow instructions, you can manage your own web
server—no special training required.

Testing with Multiple Web Browsers


Having just discussed the process of web content delivery and the acquisi-
tion of a web server, it might seem a little strange to step back and talk
about testing your websites with multiple web browsers. However, before
you go off and learn all about creating websites with HTML and CSS, do so
with this very important statement in mind: Every visitor to your website
will potentially use hardware and software configurations that are different
than your own. Their device types (desktop, laptop, netbook, smartphone,
or iPhone), their screen resolutions, their browser types, their browser win-
dow sizes, and their speed of connections will be different—remember that
you cannot control any aspect of what your visitors use when they view
your site. So, just as you’re setting up your web hosting environment and
getting ready to work, think about downloading several different web
browsers so that you have a local test suite of tools available to you. Let me
explain why this is important.

Although all web browsers process and handle information in the same
general way, there are some specific differences among them that result in
things not always looking the same in different browsers. Even users of the
same version of the same web browser can alter how a page appears by
choosing different display options or changing the size of their viewing
windows. All the major web browsers allow users to override the back-
ground and fonts specified by the web page author with those of their own
choosing. Screen resolution, window size, and optional toolbars can also
change how much of a page someone sees when it first appears on their
screens. You can ensure only that you write standards-compliant HTML
and CSS.

Do not, under any circumstances, spend hours on end designing some-


thing that looks perfect on your own computer—unless you are willing to
be disappointed when you look at it on your friend’s computer, on your
tablet, or on your iPhone.

You should always test your websites with as many of these web browsers
as possible:
Creating a Sample File 9

. Apple Safari (http://www.apple.com/safari/) for Mac and Windows

. Google Chrome (http://www.google.com/chrome) for Windows

. Mozilla Firefox (http://www.mozilla.com/firefox/) for Mac,


Windows, and Linux
. Microsoft Internet Explorer (http://www.microsoft.com/ie) for
Windows
. Opera (http://www.opera.com/) for Mac, Windows, and
Linux/UNIX

Now that you have a development environment set up, or at least some
idea of the type you’d like to set up in the future, let’s move on to creating a
test file.

Creating a Sample File


Before we begin, take a look at Listing 1.1. This listing represents a simple
piece of web content—a few lines of HTML that print “Hello World!
Welcome to My Web Server.” in large, bold letters on two lines centered
within the browser window.

LISTING 1.1 Our Sample HTML File


<html>
<head>
<title>Hello World!</title>
</head>
<body>
<h1 style=”text-align: center”>Hello World!<br/>Welcome to My Web
➥Server.</h1>
</body>
</html>

To make use of this content, open a text editor of your choice, such as Notepad NOTE
(on Windows) or TextEdit (on a Mac). Do not use WordPad, Microsoft Word, You will learn a bit about text
editors in Chapter 2,
or other full-featured word-processing software because those programs create
“Understanding HTML and
different sorts of files than the plain-text files we use for web content. XHTML Connections.” Right
Type the content that you see in Listing 1.1, and then save the file using now, I just want you to have a
sample file that you can put on
sample.html as the filename. The .html extension tells the web server that
a web server!
your file is, indeed, full of HTML. When the file contents are sent to the web
browser that requests it, the browser will also know that it is HTML and
will render it appropriately.
10 CHAPTER 1 Publishing Web Content

Now that you have a sample HTML file to use—and hopefully somewhere
to put it, such as a web hosting account—let’s get to publishing your web
content.

Using FTP to Transfer Files


As you’ve learned so far, you have to put your web content on a web serv-
er to make it accessible to others. This process typically occurs by using
File Transfer Protocol (FTP). To use FTP, you need an FTP client—a program
used to transfer files from your computer to a web server.

FTP clients require three pieces of information to connect to your web serv-
er; this information will have been sent to you by your hosting provider
after you set up your account:
. The hostname, or address, to which you will connect

. Your account username

. Your account password

After you have this information, you are ready to use an FTP client to
transfer content to your web server.

Selecting an FTP Client


Regardless of the FTP client you use, FTP clients generally use the same
type of interface. Figure 1.4 shows an example of FireFTP, which is an FTP
client used with the Firefox web browser. The directory listing of the local
machine (your computer) appears on the left of your screen and the direc-
tory listing of the remote machine (the web server) appears on the right.
Typically, you will see right-arrow and left-arrow buttons—as shown in
Figure 1.4. The right arrow sends selected files from your computer to your
web server; the left arrow sends files from the web server to your comput-
er. Many FTP clients also enable you to simply select files, and then drag
and drop those files to the target machines.

There are many FTP clients freely available to you, but you can also trans-
fer files via the web-based File Manager tool that is likely part of your web
server’s control panel. However, that method of file transfer typically
introduces more steps into the process and isn’t nearly as streamlined (or
simple) as installing an FTP client on your own machine.
Using FTP to Transfer Files 11

FIGURE 1.4
The FireFTP interface.

Here are some popular free FTP clients:


. Classic FTP (http://www.nchsoftware.com/classic/) for Mac and
Windows
. Cyberduck (http://cyberduck.ch/) for Mac
. Fetch (http://fetchsoftworks.com/) for Mac
. FileZilla (http://filezilla-project.org/) for all platforms
. FireFTP (http://fireftp.mozdev.org/) Firefox extension for all plat-
forms

When you have selected an FTP client and installed it on your computer, you
are ready to upload and download files from your web server. In the next
section, you’ll see how this process works using the sample file in Listing 1.1.

Using an FTP Client


The following steps show how to use Classic FTP to connect to your web
server and transfer a file. However, all FTP clients use similar, if not exact,
interfaces. If you understand the following steps, you should be able to use
any FTP client.

Remember, you first need the hostname, the account username, and the
account password.
1. Start the Classic FTP program and click the Connect button. You will
be prompted to fill out information for the site to which you want to
connect, as shown in Figure 1.5.
Visit https://textbookfull.com
now to explore a rich
collection of eBooks, textbook
and enjoy exciting offers!
12 CHAPTER 1 Publishing Web Content

FIGURE 1.5
Connecting to a new site in
Classic FTP.

2. Fill in each of the items shown in Figure 1.5 as follows:

. The site Label is the name you’ll use to refer to your own site.
Nobody else will see this name, so enter whatever you want.
. The FTP Server is the FTP address of the web server to which
you need to send your web pages. This address will have been
given to you by your hosting provider. It will probably be
yourdomain.com, but check the information you received when
you signed up for service.
. The User Name field and the Password field should also be
completed using information given to you by your hosting
provider.
. Don’t change the values for Initial Remote Directory on First
Connection and Initial Local Directory on First Connection
until you are used to using the client and have established a
workflow.
3. When you’re finished with the settings, click OK to save the settings
and establish a connection with the web server.
You will see a dialog box indicating that Classic FTP is attempting to
connect to the web server. Upon successful connection, you will see
an interface similar to Figure 1.6, showing the contents of the local
directory on the left and the contents of your web server on the right.
Using FTP to Transfer Files 13

FIGURE 1.6
A successful connection to a
remote web server via Classic FTP.

4. You are now almost ready to transfer files to your web server. All that
remains is to change directories to what is called the document root of
your web server. The document root of your web server is the directo-
ry that is designated as the top-level directory for your web content—
the starting point of the directory structure, which you will learn
more about later in this chapter. Often, this directory will be named
public_html (as shown in Figure 1.6), www (also shown in Figure 1.6,
as www has been created as an alias for public_html), or htdocs. This
is not a directory that you will have to create because your hosting
provider will have created it for you.
Double-click the document root directory name to open it. The dis-
play shown on the right of the FTP client interface should change to
show the contents of this directory. (It will probably be empty at this
point, unless your web hosting provider has put placeholder files in
that directory on your behalf.)
5. The goal is to transfer the sample.html file you created earlier from
your computer to the web server. Find the file in the directory listing
on the left of the FTP client interface (navigate around if you have to)
and click it once to highlight the filename.
14 CHAPTER 1 Publishing Web Content

6. Click the right-arrow button in the middle of the client interface to


send the file to the web server. After the file transfer is completed,
the right side of the client interface should refresh to show you that
the file has made it to its destination.
7. Click the Disconnect button to close the connection, and then exit out
of the Classic FTP program.

These steps are conceptually similar to the steps you will take anytime you
want to send files to your web server via FTP. You can also use your FTP
client to create subdirectories on the remote web server. To create a subdi-
rectory using Classic FTP, click the Remote menu, and then click New
Folder. Different FTP clients will have different interface options to achieve
the same goal.

Understanding Where to Place Files


on the Web Server
An important aspect of maintaining web content is determining how you
will organize that content—not only for the user to find, but also for you to
maintain on your server. Putting files in directories will help you to man-
age those files.

Naming and organizing directories on your web server, and developing


rules for file maintenance, is completely up to you. However, maintaining
a well-organized server simply makes your management of its content
more efficient in the long run.

Basic File Management


As you browse the Web, you might have noticed that URLs change as you
navigate through websites. For instance, if you’re looking at a company’s
website and you click on graphical navigation leading to the company’s
products or services, the URL will probably change from

http://www.companyname.com/

to

http://www.companyname.com/products/

or

http://www.companyname.com/services/
Understanding Where to Place Files on the Web Server 15

In the previous section, I used the term document root without really
explaining what that is all about. The document root of a web server is
essentially the trailing slash in the full URL. For instance, if your domain is
yourdomain.com and your URL is http://www.yourdomain.com/, the docu-
ment root is the directory represented by the trailing slash (/). The docu-
ment root is the starting point of the directory structure you create on your
web server; it is the place where the web server begins looking for files
requested by the web browser.

If you put the sample.html file in your document root as previously direct-
ed, you will be able to access it via a web browser at the following URL:

http://www.yourdomain.com/sample.html

If you were to enter this URL into your web browser, you would see the
rendered sample.html file, as shown in Figure 1.7.

FIGURE 1.7
The sample.html file accessed via
a web browser.

However, if you created a new directory within the document root and put
the sample.html file in that directory, the file would be accessed at this URL:

http://www.yourdomain.com/newdirectory/sample.html

If you put the sample.html file in the directory you originally saw upon
connecting to your server—that is, you did not change directories and
place the file in the document root—the sample.html file would not be
accessible from your web server at any URL. The file will still be on the
machine that you know as your web server, but because the file is not in
the document root—where the server software knows to start looking for
files—it will never be accessible to anyone via a web browser.
16 CHAPTER 1 Publishing Web Content

The bottom line? Always navigate to the document root of your web server
before you start transferring files.

This is especially true with graphics and other multimedia files. A common
directory on web servers is called images, where, as you can imagine, all
the image assets are placed for retrieval. Other popular directories include
css for stylesheet files (if you are using more than one) and js for external
JavaScript files. Or, if you know you will have an area on your website
where visitors can download many different types of files, you might sim-
ply call that directory downloads.

Whether it’s a ZIP file containing your art portfolio or an Excel spreadsheet
with sales numbers, it’s often useful to publish files on the Internet that
aren’t simply web pages. To make a file available on the Web that isn’t an
HTML file, just upload the file to your website as if it were an HTML file,
following the instructions provided earlier in this chapter for uploading.
After the file is uploaded to the web server, you can create a link to it (as
you’ll learn in later chapters). In other words, your web server can serve
much more than HTML.

Here’s a sample of the HTML code that you will learn more about later in
this book. The following code would be used for a file named artfolio.zip,
located in the downloads directory of your website, and link text that
reads “Download my art portfolio!”:
<a href=”/downloads/artfolio.zip”>Download my art portfolio!</a>

Using an Index Page


When you think of an index, you probably think of the section in the back
of a book that tells you where to look for various keywords and topics. The
index file in a web server directory can serve that purpose—if you design
it that way. In fact, that’s where the name originates.

The index.html file (or just index file, as it’s usually referred to) is the name
you give to the page you want people to see as the default file when they
navigate to a specific directory in your website. If you’ve created that page
with usability in mind, your users will be able to get to all content in that
section from the index page.

For example, Figure 1.8 shows the drop-down navigation and left-side
navigation both contain links to three pages: Solutions Overview (the sec-
tion index page itself), Connection Management, and Cost Management.
Random documents with unrelated
content Scribd suggests to you:
“There’s a play here with a kind of an idea in it. It’s hopeless as it
stands, of course, but it might be worked over a little. It’s written by
a man named Vicksburg, or Vickery, or something like that. Funny
thing—he suggests that Sheila Kemble would be the ideal woman for
the principal part. And, do you know, I’ve been thinking she has the
makings of a star some day. Had you ever thought of that?”
“No,” said Reben, craftily.
“Well, I believe she’ll bear watching.”
In after-years this play-returner used to say, “I put Reben on to
the idea that there was star material in Kemble, before he ever
thought of it himself.”
But long before either of them thought of Sheila Kemble as a
star, that destiny had been dreamed and planned for her by Sheila
Kemble.
Frivolous as she appeared on the stage and off, her pretty head
was full of sonorous ambitions. That head was not turned by the
whirlwinds of adulation, or drugged by the bouquets of flattery,
because it was full of self-criticism. She was struggling for
expressions that she could not get; she was groping, listening,
studying, trying, discarding, replacing.
She thought she was free from any nonsense of love. Nonsense
should not thwart her progress and make a fool of her, as it had of
so many others. It should not interrupt her career or ruin it as it had
so many others. She would make friends with men, oh yes. They
were so much more sensible, as a rule, than women, except when
they grew sentimental. And that was a mere form of preliminary
sparring with most of them. Once a girl made a fellow understand
that she was not interested in spoony nonsense, he became himself
and gave his mind a chance. And all the while nature was rendering
her more ready to command love from without, less ready to
withstand love from within. She was becoming more and more of an
actress. But still faster and still more was she becoming a woman.

While Sheila was drafting herself a future, Eldon was gnashing


his teeth in a pillory of inaction. He could make no step forward and
he could not back out. He had taken cheap and nasty lodgings in the
same boarding-house with Vincent Tuell, who added to his
depression by his constant distress. Tuell could not sleep nights or
days; he filled Eldon’s ears with endless denunciations of the stage
and with cynical advice to chuck it while he could. Eldon would
probably have taken Tuell’s advice if Tuell had not urged it so
tyrannically. In self-defense Eldon would protest:
“Why don’t you leave it yourself, man? You ought to be in the
hospital or at home being nursed.”
And Tuell would snarl: “Oh, I’d chuck it quick enough if I could.
But I’ve got no other trade, and there’s the pair of kiddies in school
—and the wife. She’s sick, too, and I’m here. God! what a business!
It wouldn’t be so bad if I were getting anywhere except older. But
I’ve got a rotten part and I’m rotten in it. Every night I have to
breeze in and breeze out and fight like the devil to keep from dying
on the job. And never a laugh do I get. It’s one of those parts that
reads funny and rehearses the company into convulsions and then
plays like a column from the telephone-book. I’ve done everything I
could. I put in all the old sure-fire business. I never lie down. I trip
over rugs, I make funny faces, I wear funny clothes, but does
anybody smile?—nagh! I can’t even fool the critics. I haven’t had a
clipping I could send home to the wife since I left the big town.”
Eldon had been as puzzled as Tuell was. He had watched the
expert actor using an encyclopedia of tricks, and never achieving
success. Tuell usually came off dripping with sweat. The moment he
reached the wings his grin fell from him like a cheap comic mask
over a tragic grimace of real pain and despair. In addition to his
mental distress, his physical torment was incessant. In his boarding-
house Tuell gave himself up to lamentations without end. Eldon
begged him to see a doctor, but Tuell did not believe in doctors.
“They always want to get their knives into you,” he would growl.
“They’re worse than the critics.”
One day Eldon made the acquaintance of a young physician
named Edie, who had recently hung a sign in the front window and
used the parlor as an office during certain morning hours. Patients
came rarely, and the physician berated his profession as violently as
Tuell his. Eldon persuaded the doctor to employ some of his leisure
in examining Tuell. He persuaded Tuell to submit, and the doctor’s
verdict came without hesitation or delicacy:
“Appendicitis, old man. The quicker you’re operated on the better
for you.”
“What did I tell you?” Tuell snarled. “Didn’t I say they were like
critics? Their only interest in you is to knife you.”
The young doctor laughed. “Perhaps the critics turn up the truth
now and then, too.”
But Tuell answered, bitterly: “Well, I’ve got to stand them. I
haven’t got to stand for you other butchers.”
Eldon apologized for his friend’s rudeness, but the doctor took no
offense: “It’s his pain that’s talking,” he said. “He’s a sick man. He
doesn’t know how sick he is.”
One matinée day Tuell was like a hyena in the wings. He swore
even at Batterson. On the stage he was more violently merry than
ever. After the performance Eldon looked into his dressing-room and
asked him to go to dinner with him. Tuell refused gruffly. He would
not eat to-day. He would not take off his make-up. The sweat was
everywhere about his greasy face. His jaw hung down and he
panted like a sick dog. Eldon offered to bring him in some food—
sandwiches or something. Tuell winced with nausea at the mention.
Then an anguish twisted through him like a great steel gimlet. He
groaned, unashamed. Eldon could only watch in ignorant
helplessness. When the spasm was over he said:
“You’ve got to have a doctor, old man.”
“I guess so,” Tuell sighed. “Get that young fellow, Edie. He won’t
rob me much. And he’ll wait for his fee.”
Eldon made all haste to fetch Edie from the boarding-house.
They returned to find Tuell on the floor of his room, writhing and
moaning, unheeded in the deserted theater. The doctor gave Eldon a
telephone number and told him to demand an ambulance at once.
Tuell heard the word, and broke out in such fierce protest that
the doctor countermanded the order.
“I can’t go to any hospital now,” Tuell raged. “Haven’t you any
sense? You know there’s an evening performance. Get me through
to-night, and I can rest all day to-morrow. I’ve got to play to-night.
I’ve got to! There’s no understudy ready.”
He played. They set a chair for him in the wings and the
physician waited there for him, piercing his skin with pain-deadening
drugs every time he left the stage. There was sympathy enough
from the company. Even Batterson was gentle, his fierce eyes fiercer
with the cruelty of the situation. The house was packed, and “ringing
down on capacity” is not done.
Tuell sat in a stupor, breathing hard like a groggy prize-fighter.
But whenever his cue came it woke him as if a ringside gong had
shrilled. He flung off his suffering and marched out to his
punishment. Only, to-night, somehow, he lacked his usual speed.
The suffering and the bromides dulled him so that in place of
dashing on the stage he sauntered on; in place of slamming his lines
back he just uttered them.
And somehow the laughter came that had never come before—
the laughter the author had imagined and had won from the
company at the first reading from the script.
From the wings they could see Tuell’s knuckles whiten where he
clung to a chair to keep from falling.
The audience loved Tuell to-night, never suspected his
anguishes, and waited for him, laughed when he appeared. For his
final exit he had always stumbled off, whooping with stage laughter.
It had always resounded unaccompanied. To-night he was so spent
that he was capable only of a dry little chuckle. To his ears it was the
old uproar. To the audience it was the delicious giggle of this spring’s
wind in last year’s leaves. It tickled the multitude and all those
united titters made a thunder.
Tuell staggered past the dead-line of the wings and fell forward
into Eldon’s arms, whispering:
“I got ’em that time. Damn ’em, I got ’em at last.”
Eldon helped him to his chair, helped lift him in his chair and
carry him to the ambulance. Tuell didn’t know whither they were
taking him. He clawed at Eldon’s arm and muttered:
“I must write to the wife and tell her how I killed ’em to-night.
And I’ve got the trick now. I’ve just found the secret—just to-night.
Of course there wouldn’t be a critic there. Oh no, of course not.”
But there was a Critic there.
CHAPTER XIV
The next morning, as Eldon was leaving his boarding-house to
call on Tuell at the hospital, he was astounded to see Batterson at
the foot of the steps.
“I’m looking for you,” said the stage-manager.
Batterson’s eyes were so bloodshot and so wet that Eldon stared
his surprise. Batterson grumbled:
“No, I’m not drunk. Tried to get drunk, but couldn’t.”
Eldon was at a loss for what to say to this. Suddenly Batterson
was clinging to his arm, and sobbing with head bent down to hide
his weakness from the passers-by.
“Why, Mr. Batterson,” Eldon stammered, “what’s wrong?”
“Tuell’s dead.”
“No! My God!”
“He never came out of the ether. They were too late to save him.
The appendix had burst while he was working last night.”
Eldon, remembering that uncanny battle, felt the gush of brine to
his eyes. He hung his head for concealment, too.
Batterson raged on: “Remember what Hamlet said: ‘They say he
made a good end.’ Tuell was only a mummer, but he died on the
firing-line, makin’ ’em laugh. If he’d been a soldier trying to save
somebody from paying taxes without representation or trying to
protect some millionaire’s oil-wells, or a fireman trying to rescue
somebody’s furniture—they’d have called him a damned hero. But he
was only an actor—he only tried to make people happy. He was a
comedian, and not a good comedian—just a hard worker; one of
these stage soldiers trying to keep the theater open.
“He did the best he knew how. The critics ripped him open and
made him funnier than he could make himself. But he kept right on.
I used to roast him worse than they did, God help me! But he never
laid down on us. He died in his make-up. They didn’t take his
grease-paint off till afterward. They didn’t know how. I had to do it
for him when I got there. Poor old painted face, with the comedian’s
smile branded on it! That was his trade-mark. He was only an actor.”
Eldon noted that Batterson had led him, not to the hospital, but
to the theater, with its electric signs, its circus lithographs, its gaudy
ballyhoo of advertisement.
Batterson groaned: “Well, here’s the shop. We’ve got to do what
Tuell did. The theater’s got to keep open. It’s another sell-out to-
night. Somebody has to play Tuell’s part to-night. I want you to.”
In spite of the horror that filled his heart Eldon felt a shaft of
hope like a thrust of lightning in the night. Then the dark closed in
again, for Batterson went on:
“It’s only for to-night, old boy. I’ve wired to New York and a good
man’ll be here to-morrow. But there’s to-night. You’ve got to go on.
You fell down the other time, and I guess I told you so, but you
didn’t have a rehearsal. I can coach you up to-day. I’ve called the
other people. They ought to be here now.”
And so they were.
On the gloomy stage before the empty house the company stood
about in somber garb, under the oppression of Tuell’s death.
Batterson walked down to the footlights, clapped his hands, and
said:
“Places, please, ladies and gentlemen, for poor old Tuell’s first
scene. Mr. Eldon will play the part to-night.”
Those who were not on at the entrance drew to the sides. The
others moved here and there and stood at their posts. Batterson
directed with an unwonted calm, with a dismal patience.
The part Eldon held in his hand had been taken from Tuell’s
trunk. The dead hands seemed to cling to it with grisly jealousy. The
laughter of Tuell seemed to haunt the place like the echo of a
maniac’s voice. Eldon could not give any color to the lines. He could
barely utter them. The company gave him his cues with equal
lifelessness.
Sheila was present and read her flippancies in a voice of terror—
the terror of youth before the swoop of death. Mrs. Vining muttered
her cynicisms with the drear bitterness of one to whom this familiar
sort of thing had happened once more.
When the detached scenes had been run over several times
Batterson dismissed Eldon first that he might go and study. As he
went he heard Batterson saying:
“Help him out to-night, ladies and gentlemen. Do the best you
can. To-morrow we’ll have a regular man here. And now about poor
Tuell. Some of the comic-opera people in town will sing at his
funeral. His wife is coming out to get him. Mr. Reben telegraphed to
pay the expenses of taking him back. I guess he didn’t leave the
wife anything much—except some children. We’d better get up a
little benefit, I guess—a matinée, probably. The other troupes in
town will help, of course. If any of you know any good little one-act
plays, let’s have ’em. I’ve got a screaming little farce we might throw
on. I think I can get some of the vaudeville people to do a few comic
turns.”

That night Eldon slipped into the dead man’s shoes—at least he
wore the riding-boots and the hunting-coat and carried the crop that
Tuell had worn. Tuell had had them made too large—for the comic
effect that did not come. They fitted Eldon fairly well. But it was like
acting in another man’s shroud.
He was without ambition, without hope of personal profit. He
was merely a stop-gap. He was too completely gloomy even to feel
afraid of the audience. He was only a journeyman finishing another
man’s job.
His memory worked like a machine, so independently of his mind
that he seemed to have a phonograph in his throat. He kept
wondering at the little explosions of laughter at his words.
He saw the surprise in Sheila’s eyes as he brought down the
house—with so different a laughter now. He murmured to her in
sudden dread, “Are they guying me again?”
“No, no,” she answered. “Go on; you’re splendid!”
The news of Tuell’s death had taken little space in the evening
papers. The audience, as a whole, was oblivious of it, or of what he
had played. There was none of the regret on the other side of the
footlights that solemnized the stage. The play had been established
as a successful comedy. People came to laugh, and laughed with
confidence.
But the pity of Tuell’s fate ruined any joy Eldon might have taken
in the success he was winning. He played the part through in the
same dull, indifferent tone. When he made his final exit he laughed
as he had heard Tuell laugh, with uncanny mimicry as if a ghost
inhabited him. He was hardly conscious of the salvo of applause that
followed him. He supposed that some one still on the stage had
earned it. He sighed with relief as he reached the shelter of the dark
wings. Batterson, who had hovered near him, ready with the
unnecessary prompt-book, glared at him in amazement and
growled:
“Good Lord! Eldon, who’d have ever picked you for a comedian?”
Eldon smiled at what he imagined to be sarcasm, and took from
his pocket the little pamphlet he had carried with him for quick
reference. He offered it to Batterson. Batterson waved it back.
“Keep it, my boy. When the other fellow gets here from New York
he can play your old part.”
CHAPTER XV
The next night Eldon reached the theater in a new mood. He had
been promoted. He still felt sorry for poor Tuell. The grief of the wife
whom he had met at the train and taken to the undertaker’s shop
where Tuell rested had torn his heart as with claws. He had told her
all things beautiful of Tuell. He had wept to see her weep. He wept
his heart clean as a sheep’s heart.
As Villon said, “The dead go quick.” Eldon was ashamed to be so
merciless, but in spite of himself ambition blazed up in him. He was
a comedian. Batterson had told him so. The house had told him so.
Sheila had murmured, “You’re splendid.”
And now he was a comedian with a screamingly funny rôle. Now
he could build it up. He had been working on it half unconsciously all
night and all day.
The second night he marched into the scene with the authority of
one who is about to be very funny. In his first scenes he delivered
his lines with enthusiasm, with appreciation of their humor. He took
pains not to “walk into his laughs” as he had done the night before,
when he had not expected any laughs. He waited for his laughs. He
was amazed to note that they did not come. His pause left a hole in
the action. He worked harder, underlined his important words,
cocked his head as one who says, “The story I am about to tell you
is the funniest thing you ever heard. You’ll die when you hear it.”
It was the scene that died. A new form of stage-fright sickened
him. Hope perished. He was not a comedian, after all. His one
success had been an accident.
When the first curtain fell he slunk away by himself to avoid
Batterson’s searching eyes. To complete his shame he saw that
Batterson was talking earnestly with the new-comer from New York.
Old Mrs. Vining sauntered his way. He tried to escape, but the
heavy standard of a bunch-light cut him off. She approached him
and began in that acid tone of hers:
“Young man, there are two things that are important to a
comedian. One is to get a laugh, and the other is to nail it. You got
your laughs last night and you’ve lost ’em to-night. Do you know
why?”
“If I only did! I’m playing twice as hard to-night.”
“You bet you are, and you’re hard as zinc. You keep telling the
audience how funny you’re going to be, and that finishes you. Now
you’ve lived long enough to know that there are few jokes in the
world so funny that they can stand being boosted before they’re
told. Play your part straight, man. You can fake pathos and rub it in,
but of all things always play comedy straight.
“And another thing, don’t fidget! One of the best comedians that
ever walked the stage told me once, ‘I know only one secret for
getting laughs, and that is, Nobody must move when the laugh
comes.’ But to-night you never waited for anybody else to kill your
laughs. You butchered ’em yourself by lolling your head and making
fool gestures. Quit it! Now you go on in the next act and play the
part as you did last night. Be gloomy and quiet and depressed.
That’s what makes ’em laugh out there—the sight of your misery.
There’s nothing funny to them in your being so damned cheerful as
you were to-night.”
Eldon said, “Thank you very much, Mrs. Vining.” But he was not
convinced of anything except his fatal and eternal unfitness to be an
actor. He walked into the second act carrying his old burden of
dejection; he rather moaned than delivered his lines. And the people
laughed.
The cruelty of the public heart angered Eldon and he made
further experiment in dolor. Laughs came now that he had not
secured the night before. The others were bigger than then. He
threw into some of his lines such subcellar misery that he broke up
Sheila. When he made the laughing exit he did not even chuckle, he
moaned. And the result was a tornado. People mopped their eyes.
Batterson met him with a quizzical smile: “You got ’em going to-
night nearly as good as the time your lantern went out.”
That was higher praise than it sounded at first hearing.
When Mrs. Vining made her exit she said, “Aha! What did I tell
you, young man?”
When Sheila came off she sought him out, and cried, “Oh, you
were wonderful, simply wonderful!”
And when Batterson growled at her: “You spoiled several of his
best laughs by talking through ’em. You ought to know better than
that,” Sheila was so pleased for Eldon’s sake that she relished the
rebuke.
Mrs. Vining had warned him to nail his laughs. At the next
performance he tried to repeat his exact effects. Some of them he
forgot, some of them he remembered. But they did not work this
time. Others went better than ever. Each point was a new battle.
And so it was with every repetition. No two audiences were alike.
Each had its own individuality. He began to study audiences as
individuals. The first part of his first act was his period of getting
acquainted. Some houses were quick and some slow, some noisily
demonstrative, some quietly satisfied. It took all his powers to play
his part. And he could not tire of it because every night was a first
night in a new rôle.

Success made another man of him. He was interested in his task.


He was winning praise for it. The management voluntarily raised his
salary a little. He held his head a trifle higher.
Sheila noted the change at once. She liked him the better for it.
She repeated her invitation to tea. He accepted now, and appeared
in some new clothes. They were vastly becoming. On the stage he
played a middle-aged henpecked plebeian. Off the stage he was
young and handsome and thoroughbred.
He was a reader, too, and Sheila, like most actresses, was an
omnivorous browser. They talked books. She lent him one of hers.
He cherished it as if it were a breviary. They argued over literature
and life. He ventured to contradict her. He was no longer a big
mastiff at heel. He was forceful and stubborn. These qualities do not
greatly displease a woman who likes a man.
Mrs. Vining was amused at first by the change in Sheila. Latterly
the girl was constantly quoting “Mr. Eldon.” By and by it was “As
Floyd Eldon says,” and one day Mrs. Vining heard, “Last night Floyd
was telling me.” Then Aunt John grew alarmed, for she did not want
Sheila to be in love—not for a long while yet, and never with an
actor.
And Sheila had no intention of falling in love with an actor. But
this did not prevent her from being the best of friends with one. All
of Eldon’s qualities charmed Sheila as she discovered them. She had
leisure for the discovery. There were no rehearsals; business was
good at the theater; Eldon grew better and better in his
performance. Sheila kept up her pace and enlarged her following.
They dwelt in an atmosphere of contentment. But as her personal
public increased and as the demands on her spirits and her time
increased she began to take more pleasure in the company of Eldon
and to like him best alone. She began to break old engagements, or
fulfil them briefly, and to refuse new invitations.
Mrs. Vining was not able to be about for a while. Her neuralgia
was revived by the knife-winds of Chicago. But Sheila and Eldon
found them highly stimulating. He joined her in her constitutionals.
Chicago was large enough to give them a kind of seclusion by
multitude, the solitude of a great forest. Among Chicago’s myriads
the little “Friend in Need” company was lost to view. It was possible
to go about with Eldon and never meet a fellow-trooper; to walk
miles with him along the Lake front, or through Lincoln Park, to sidle
past the pictures in the Art Institute or the Field Museum, and rest
upon the benches in galleries where the dumb beauty on the walls
warmed the soul to sensitiveness.
And when they were not alone their hearts seemed to commune
without exchange of word or glance. He told her first how wonderful
an artist she was, and by and by he was crediting her art to her
wonderful “personality.” She told him that he had “personality,” too,
lots of it, and charming. She told him that the stage needed men of
birth and breeding and higher education, especially when these were
combined with such—such—she could hardly say beauty—so she fell
back again on that useful term—“personality.”
They never tired of discussing the technic of their trade and its
emotional grandeurs. He told her that his main ambition was to see
her achieve the heights God meant her for; he only wished that he
might trudge on after her, in her wake. She told him that he had far
greater gifts than she had, and that his future was boundless.
Finally she convinced him that she was convinced of this, and
over a tea-table in the Auditorium Hotel he murmured—and
trembled with the terrific audacity of it as he murmured:
“If only we could always play together—twin stars.”
She was shocked as if she had touched a live wire of frightful
beatitude. And her lips shivered as she mumbled, “Would you like
that?”
He could only sigh enormously. And his eyes were full of devout
longing as he whispered, “Let’s!”
They burst into laughter like children planning some tremendous
game. And then Mrs. Vining had to walk into their cloud-Eden and
dissolve it into a plain table at which she seated herself.

Mrs. Vining was thinking “Aha!” as she crossed the room to their
table. “It’s high time I was getting well. Affairs have been
progressing since I began to nurse my neuralgia.”
She resolved to stick around, like the “demon chaperon” of
Fontaine Fox’s comic pictures. At all costs she must rescue Sheila
from the wiles of this good-looking young man. For her ward to lose
her head and find her heart in an affair with an actor would be a
disaster indeed; the very disaster that Sheila’s mother had warned
her against.
Of course Sheila’s mother had married an actor and been as
happy as a woman had a right to expect to be with any man. And of
course Mrs. Vining’s own dear dead John Vining had been the most
lovable of rascals. But such bits of luck could not keep on recurring
in the same family.
And Mr. Reben did not believe in marriage for actors, either. He
had many reasons far from romantic. The public did not like its
innocent heroines to be wives. The prima donna’s husband is a
proverb of trouble-making. Separated, the couple pine; united, they
quarrel with other members of the company or with each other.
Children arrive contrary to bookings and play havoc with youth and
vivacity, changing the frivolous Juliet into a Nurse or a Roman
Matron.
Reben would have been infuriated to learn that Sheila Kemble,
his Sheila of the golden future, was dallying on the brink of an
infatuation for an infatuated minor member of one of his companies.
A flirtation, even, was too dangerous to permit. He would have
dismissed Eldon without a moment’s pity if he had known what none
of the company had yet suspected. Unwittingly he accomplished the
effect he would have sought if he had been aware.
Reben ran out to Chicago ostensibly, according to his custom, to
inspect the troupe in the last fortnight of its run there. He invited
Sheila to supper with Mrs. Vining. He criticized Sheila severely and
praised Miss Griffen. Later, as if quite casually, he spoke to Mrs.
Vining of a new play he had found abroad. It was a man star’s play.
“I bought it for Tom Brereton,” he said, “but the leadin’ woman’s rôle
is rather interestin’.”
He described one of her scenes and noted that Sheila was
instantly excited. It was one of those craftsmanly achievements the
English dramatists arrive at oftener than ours, and it had made the
instant fame of the actress who played it in London. Having dropped
this golden apple before Atalanta, he changed the subject carelessly.
Sheila turned back to the apple:
“Tell me more about the play, please!”
Reben told her more, permitted her to coax him to tell it all. He
yawned so crudely that she would have noticed his wiles if she had
been able to think of anything but that rôle; for an actress thrills at
the thought of putting on one of these costumes of the soul as
quickly as an average woman grows incandescent before a new
gown.
Sheila clasped her hands and shook her head like a beggar
outside a restaurant window: “Oh, but I envy the woman who plays
that part! Who is she?”
“Parton, I suppose,” Reben yawned. “But she’s fallen off lately.
Gone and got herself in love—and with a fool actor, of all people!
The idiot! I’ve a notion to chuck her. After all the money and
publicity I’ve wasted on her, to fall for a dub like that!”
Sheila did not dare plead for the part. But her eyes prayed; her
very attitude implored it.
Reben laughed: “In case anything awful happened to Parton—like
sudden death or matrimony—I don’t suppose the rôle would interest
you?”
“I’d give ten years off my life to play that part.”
“Would you, now?” Reben laughed. “You don’t mean it. Ten years
off your life, eh? Would you give ten dollars off your salary?” He
chuckled at his shrewdness.
But she answered, solemnly, “I’d play it for nothing.”
“Well, well!” said Reben. “That would be a savin’!” He always
would have his little joke. Then he said: “But jokin’ aside, of course I
couldn’t afford to let you work for nothin’. Fact is, if the play was a
success I could afford to pay you a little better than you’re gettin’
now. What are you gettin’ now?”
“Seventy-five,” said Sheila.
“Is that all!” said Reben. “Well, well, I don’t have to be as stingy
as that. But there’s one thing I can’t afford to do and that’s to work
for an actor—or actress—who quits me as soon as I make him—or
her.”
“I’d never quit you if you gave me chances like that,” Sheila
sighed, hopelessly.
“So they all tell me,” said Reben. “Then they chuck me for the
management of Cupid & Co. Would you be willin’ to sign a five years’
contract with me, young lady?”
“In a minute!”
“Well, well! I’ll see what can be done. Good night!”
He left her to fret herself to an edge with the insomnia of frantic
ambition. The next day he sent her a contract to look over.
“Aha!” said Sheila to Mrs. Vining. “That’s his little game. He
wanted me all the time. Why couldn’t he have said so? I’ll make him
pay for being so clever.”
She sent the contract back with emendations.
He emended her emendations and returned it to her.
She emended further and wrote in the margin, “Oh, Mr. Reben!”
and, “Greedy, greedy!”
He rather enjoyed the duel with the little haggler. He belonged to
the race that best manages to combine really good art with really
good business and really good generosity.
When at last he had bargained Sheila to the wall he made her a
present of better terms than she had accepted—as if he were
tossing her a handsome diamond.
Sheila embraced him and called him an angel. He belonged,
indeed, to the same race as the only original angels.
She signed the contract with exclamations of gratitude. With his
copy in his pocket he put out both hands and wished her all the
glory he planned for her. Then he told her to get ready to leave
within a week for New York and rehearsals.
He had brought to Chicago a young woman stage-named Dulcie
Ormerod to replace her. He wanted Dulcie to play the part at least a
week so that the company could be advertised as “exactly the same
that appeared in Chicago.”
When he had gone Sheila fell from the clouds—at least she
struck a hole in the air and sank suddenly nearer to the earth. She
cried, “Oh, Aunt John, I forgot to ask if he wanted you in the new
play!”
“No, he doesn’t, dearie. He told me how sorry he was that there
was no part for me while you were signing the contract.”
“Oh, I’m so sorry! I won’t leave you!”
“Of course you will, my child. You can’t go on forever chained to
my old slow heels. Besides, I’m too tired to learn a new part this
season. I’ll jog on out to the Coast with this company. I think
California will be good for me.”
A little later Sheila remembered Floyd Eldon. She gasped as if
she had been stabbed.
“Why, what’s wrong now, honey?” cried Mrs. Vining.
“I was just thinking—Oh, nothing!”

Sheila was dismayed at the idea of leaving Eldon, leaving him all
by himself—no, not by himself, for that Dulcie creature would replace
her in the company, and perhaps—no doubt—in his lonely heart.
Sheila had grown ever so fond of Eldon, but she could not expect
any man, least of all so handsome, so big-hearted a man, to resist
the wiles of a cat, or, worse, a kitten, who would select such a name
as “Dulcie.”
An inspiration gave Sheila sudden cheer. She would ask dear Mr.
Reben to give Eldon a chance in the new company. It would be far
better for Floyd to “create” something than to continue hammering
at his present second-hand rôle. He might have to take a smallish
part, but they would be in each other’s neighborhood, and perhaps
the star might fall ill. Eldon would step in; he would make an
enormous sensation; and then and thus in a few short months they
would have accomplished their dream—they would be revolving as
twin stars in the high sky together.
She called up Reben at the theater; he had gone to the hotel. At
the hotel, he had left for the station. At the station, he had taken the
train. Well, she would write to him or, better yet, see him in person
and arrange it the minute she reached New York.
That night she took her contract to the theater in her hand-bag.
She must tell Floyd about it.
He was loitering outside when she reached the stage door. Her
face was agleam with joy as she beckoned him under a light in the
corridor. His face was agleam, too, as he hurried forward. Before she
could whisk out her contract he brandished before her one of his
own. Before she could say, “See what I have!” he was murmuring:
“Sheila! Sheila! What do you suppose? Reben—the great Reben likes
my work. He said he thought I was worth keeping, but I ought to be
playing the juvenile lead instead of a second old man. He’s going to
shift Eric Folwell to a new production East, and he offered me his
place! Think of it! Of course I grabbed it. I’m to replace Folwell as
soon as I can get up in the part. Would you believe it—Reben gave
me a contract for three years. He’s boosted me to fifty a week
already. I’m to play this part all season through to the Coast. And
next season he’ll give me a better part in something else—and at a
better salary.
“I wanted to telephone you about it, but I was afraid to mention
it to you for fear something might prevent him from signing. But he
did!—just before he took the train. See, there’s his own great name!
After next week I’m to be your lover in the play as well as in reality.
Our dream is coming true already, isn’t it—” He hesitated before the
absolute word, then, having made the plunge, went on and
whispered, “Sheila mine!”
Sheila stared at him, at the love and triumph in his eyes; and
suddenly her cake was dough. Her mouth twisted like a child’s when
the rain begins on a holiday. She turned her head away and passed
the side of her hand childishly across her clenched eyes, whence the
tears came thronging. She half murmured, half wept:
“I’m not your Sheila. I’m that hateful old Reben’s slave. And I
don’t go any further with you. Miss—Dulcie Somebody-or-other is to
have my part. She’s prettier than I am. And I’ve got to go to New
York next week to begin rehearsals of—a horrid old B-british
success.”

The voice of the call-boy warning them of the half-hour sent


them scurrying to their cells with their plight unsolved. They had a
few chances to exchange regrets during the performance, but other
members of the company who had heard of the good luck of both of
them kept breaking in with felicitations that sounded like irony. They
were so desperate for talk that Eldon waited for Sheila in the alley
and walked to her hotel with her. Mrs. Vining went along, very much
along. They had to accept her presence; she would not be ignored.
She put in sarcastic allusions to the uselessness of good luck in this
world. In her day actors and actresses would have been dancing
along the streets over such double fortune. As to their separation, it
would be a good test of their alleged affection. If it was serious it
would outlast the test; if not, it was a good time to learn how
unimportant the whole thing was.
She regarded the elegies of young love with all the skepticism of
the old who have seen so much of it, heard so much repetition of
such words as “undying” and “forever,” and have seen the “undying”
dying all about like autumn leaves, and few of the “forevers” lasting
a year.
Sheila accepted Eldon’s invitation to have a bite of supper in the
grill-room. Mrs. Vining was in a grill-room mood and invited herself
along. Other members of the troupe appeared and visited the
funeral table with words of envy.
In the spaces between these interruptions Sheila explained her
plan to ask Reben to give Eldon a chance with the new company.
Mrs. Vining sniffed: “Sheila, you ought to have sense enough to
know that the minute you mentioned this young man’s name Reben
would send him to Australia—or fire him.”
“Fire him?” said Sheila. “He has a three years’ contract.”
“Yes, with a two weeks’ clause in it, I’ll bet.”
They fetched the contract out and looked it over again. There
was the iniquitous clause, seated like a toad overlooked among the
flowers, and now it was impossible to see the flowers for the toad.
“Oh, you ought to have changed that,” said Sheila. “It’s different
in mine.”
“I didn’t know,” said Eldon, “and I shouldn’t have dared to argue
with Reben. I was afraid he might change his mind. But I could
resign and come East and get a job with another manager.”
Mrs. Vining poured on more vinegar: “You can’t resign. That two
weeks’ notice works only one way. And if you break with Reben
you’ll have a fine chance getting in with any other manager! Besides,
why let your—well, call it ‘love’ if you want to—why let it make fools
of you both? Mr. Eldon has had a great compliment from the best
manager in the country, and a raise of salary, and a promise of his
interest. Are you thinking of slapping him in the face and kicking
your own feet out from under yourself just because this foolish little
girl is going along about her business?
“And another thing, Mr. Floyd Eldon, if you love this girl as much
as you say you’re taking a pretty way to prove it. Do you want to
ruin her career just as it’s beginning, drag this rising star back to the
drudgery of being the wife of a fifty-dollar-a-week actor? Oh, you’ll
do better. You’re the type that matinée girls make a pet of. You’ll
have draught, too, as soon as you learn a little more about your
business. But it wouldn’t help you any just now to be known as an
old married man. You mind your business and let her mind hers.
“You think you’re Romeo and Juliet in modern costume, I
suppose. Well, look what a mess they made of it. You are two fine
young things and I love you both, but you mustn’t try to prove your
devotion to each other by committing suicide together.”
Eldon’s thoughts were dark and bitter. His own career meant
nothing to him at the moment. His love of Sheila was all-important
to him, and her career was, above all, important. He said: “I
certainly won’t do anything to hurt Sheila’s career. That’s my religion
—her career.”
He poured into her eyes all the idolatry a man can feel for a
woman. He had a curious feeling that he read in her eyes a faint
fleck of disappointment. His sacrifice was perfect and complete, but
he felt an odious little suspicion that it was not absolutely welcome.
Perhaps he guessed right. Sheila was hastening to that point in
womanhood where the chief demand of her soul is not that her lover
should exalt her on a pedestal and worship her, but should tear her
thence and love her. She did not suspect this yet herself. All she
knew was that she was dissatisfied with her triumph. She bade
Eldon a ghostly farewell at the hotel elevator and went up to her
room, while he turned away to his dingy boarding-house. He had not
yet bettered his lodgings; he was trying to save his pennies against
the future need of a married man.
When Sheila had made ready for bed she put out the lights and
leaned across the sill and stared across the dark boundless prairie of
the starlit Lake. It had an oceanic vastitude and loneliness. It was as
blank as her own future.
CHAPTER XVI
The last days of Sheila’s presence with the company were full of
annoyances. There was little opportunity for communion with Floyd.
Mrs. Vining was invincibly tenacious. All day long, too, Floyd was
rehearsing his new rôle. This proved intensely difficult to him. With a
heart full of devotion to Sheila, it was worse than awkward to be
making love to the parvenue who took her place, mimicked her
intonations, made the same steps and gestures, said the same
words, and yet was so radically different.
She was a forward thing—Miss Dulcie Ormerod. She patronized
Eldon and tried to flirt with him at the same time. She forced
conversation on him when he was morose. She happened to meet
him with extraordinary coincidence when he was outside the theater.
And almost every time the two of them happened to be together
they happened to meet Sheila.
Dulcie was one of those women who seem unable to address one
without pawing or clinging—as if the arms were telephone cables,
and there were no communicating without contact.
Sheila was of the wireless type. A touch from her was as
important as a caress. To put a hand familiarly or carelessly on her
arm was not to be thought of, at least by Eldon. Others who
attempted it found that she flinched aside or moved to a distance
almost unconsciously. She kept herself precious in every way.
Eldon loathed the touch of Dulcie’s claws, especially as he could
not seem to convince Sheila that he did not enjoy her incessant
contiguity. And the prehensive Dulcie was calling him “Floyd” before
the third rehearsal.
Batterson was calling him all sorts of names of the familiarity that
implies contempt, for Eldon was not rehearsing well. He realized the
confusing inconveniences that love can weave into the actor’s trade.
If it had not been for Sheila he could have made a straight matter of
art or business out of the love-scenes with Dulcie, or he could have
thrown the hungry thing an occasional kind word to keep her quiet,
or have fallen temporarily in love with her, for Dulcie was one of
those actresses who insist that they “must feel a part to play it.” She
was forever alluding to one of her rôles in which “she knew she was
great because she wept real tears in it.”
Sheila belonged to the other school. Her father would say of a
scene, “I knew I was great in that because I could guy it.” For then
he was like the juggler who can chat with the audience without
dropping a prop—a Cyrano who can fight for his life and compose a
poem at the same time.
Sheila felt the emotions of her rôle when she first took it up, but
she conquered them as soon as she could by studying and
registering their manifestations, so that her resources were like an
instrument to play on. Thereafter her emotions were those of the
concert violinist who plays upon his audience as well as his
instrument.
Sheila watched a few rehearsals. She hated the exaggerated
sentimentalisms of Dulcie and her splay-footed comedy. Dulcie
underscored every important word like a school-girl writing a letter.
Sheila credited the audience with a sense of humor and kept its
intelligence alert. Sheila made no bones of criticizing her successor.
But when Eldon agreed with her, she was not convinced. She was far
more jealous of him than she was of her rôle. But Eldon was not
wise enough to take comfort from these proofs of her affection.
They narrowly escaped quarreling during their last few meetings.
When Sheila went away Eldon could not even go to the train with
her. Batterson held him to rehearsal.
Sheila said, “Don’t worry; Mr. Folwell will take care of me.” She
could hardly have been ignorant of the torment this meant to Eldon,
but her heart was aching, too, because he permitted a little thing
like his business to keep him from paying the last tributes of
tenderness.
Folwell was one of those affable leading men who always proffer
their leading women as much gallantry as they care to accept. He
had been a devoted suitor to Zelma Griffen and had graciously
pretended to suffer agonies of jealousy over her humming-bird
flirtations. He had done the same with the women stars of his last
three engagements. He was Scotch, and had a gift of sad-eyed
sincerity for the moment, and a vocabulary of irresistible little pet
names, and a grim earnestness about whatever interested him at
the time. His real name was, curiously, Robert Burns. He had
changed it lest he be suspected of stealing it, or of advertising a
much-advertised tobacco.
Eldon imagined that Folwell would begin to languish over Sheila
the moment the train started, and was tempted to bash in his head
so that he would be incapable of making love at all. He had won into
Sheila’s good graces by knocking an anonymous student over the
footlights. If he sent a pseudonymous actor the same way he might
clinch his success with her. He little knew that the blow he had
struck Bret Winfield had not yet ceased to sting that youth, and that
Winfield was still repeating his vow to square himself with Eldon and
with Sheila—in very different ways.
But Eldon let Folwell escape without planting his fists on him.
And he let Sheila escape without imprinting the seal of his kiss upon
her. He had never laid lip to her cheek. And now they were divorced,
without being betrothed.
If he had known how tenderly Sheila’s thoughts flew back to him,
if he had known that she locked herself in her state-room and wept
and never once saw Folwell on the train, he would have been
happier and sadder both, with the incurable perversity of a forlorn
lover. If he could have seen her very soul of souls he would have
seen what she dared not admit to herself, that she was a little
disappointed in him because he let her go. She doubted the
greatness of his love of her because he loved the artist she was so
well. Sheila was more jealous of her actress self than of Dulcie
Ormerod.
It was not many days before Eldon, too, turned his back on
Chicago, but facing westerly. The city was dear to him: he had
passed through a whole lifetime of stages there, from crushing
failure to success in a leading rôle, and from loneliness to
reciprocated love and widowerhood.
Mrs. Vining tried to console him when he turned to her as at
least a relative of Sheila’s. She made as much as she could of his
performance as Folwell’s successor. It was a creditable and a
promising beginning, though it offended her experienced standards
in countless ways. But she flattered him with honeyed words, and
she tried to wear away his love for Sheila.
She had seen so many nice young fellows and dear, sweet girls
stretched on the rack of these situations—wrenched by the wheels
of separation and all the suspicions that jealousy can imagine from
opportunity. In all mercy she wished this couple well cured of the
inflammation. She did her part to allay it with counter-irritants and
caustics. She wrote Sheila that Eldon was getting along famously
with his rôle—and with Dulcie, who was “a dear little thing and
winning excellent press notices.” She told Eldon that Sheila was in
love with her new play, and that Tom Brereton was turning her head
with his compliments. Folwell, who had the second male rôle in the
new play, was also very attentive, she said. And Sheila was going
out a good deal in New York—dancing her feet off nearly every
night. The author of the play was a third rival for her favor, in Mrs.
Vining’s chronicles.
Everything collaborated to Eldon’s torture. The “Friend in Need”
company was moving West in long jumps. Sheila’s letters had farther
and farther to go. A sudden change of booking threw them off the
track and two weeks passed without a line. He sent her day letters
and night letters as affectionate in tone as he had the face to submit
to the telegraph operators. Her answers did not satisfy him. They
were never so prompt as his calculations and he did not credit her
with restraint before the cold-eyed telegraphers.
She was far busier, too, than he imagined. Costumes were to be
ordered and fitted; the new lines to be learned; photographs to be
posed for; interviews to be given. Reben was grooming her for a star
already, without giving her an inkling of his schemes. As for flirting
with Brereton or Folwell, she was as far as possible from the thought
of such a leisurely occupation. She was having battles with them,
and still bitterer conflicts with the author.
CHAPTER XVII
In the eyes of the playwright Sir Ralph Incledon, as in the eyes of
the early Spaniards, the Americans were savages with unlimited gold
to exchange for glass beads. He had a noble contempt for all of us
except our dollars, and he was almost ashamed to take those; their
very nomenclature was vulgar and the decimal system was French.
The London success of his piece following upon his arrival at
knighthood had completely spoiled him. Other great writers and
actors who had received the accolade had been rendered a little
meeker and more knightly as knights, but Incledon became almost
unendurably offensive, even to his fellows in London. The decent
English in New York who had to meet him abominated him as
civilized Americans abroad abominate the noisy specimens of Yankee
insolence who go twanging their illiterate contempt through the
palaces and galleries and restaurants of Europe.
Sir Ralph was greatly distressed with the company Reben had
proudly mustered for him. Tom Brereton was English born and bred,
but Sir Ralph accused him of “an extraord’n’r’ly atrowcious Amayric’n
acs’nt.” Americans who had seen the London performance had been
amazed not only at the success of Miss Berkshire, but at her very
tolerance on the stage; they said she looked like a giraffe and talked
like a cow. But she pleased her own public somehow. When Sir
Ralph saw Sheila he was not impressed; he said that she was “even
wahss” than Brereton and under “absolutely neigh-o sec’mst’nces
could he permit hah to deviate from the p’fawm’nce of d’yah aold
Bahkshah.”
Sheila had flattered herself that she knew something of England
and English; she had visited the island enough, and some of its
stateliest homes; and she had had some of the worst young peers
making love to her. But Sir Ralph, she wrote her aunt, evidently
regarded her “as something between a squaw and a pork-packer’s
daughter.”
Sir Ralph threw her into such a bog of humiliation that she
floundered at every step. How could she give an intelligent reading
to a line when he wanted every word sung according to the idiom of
another woman of another race? How could she embody a rôle in its
entirety when every utterance and motion was to be patterned on
Sir Ralph’s wretched imitations of a woman she had never seen?
Sir Ralph not only threw his company into a panic, but he
revealed a positive genius for offending the reporters, the critics, the
public. Before the first curtain rose there was a feeling of hostility,
against which the disaffected and disorganized players struggled in
vain.
His play was a beautiful structure, full of beautiful thoughts
expertly wrought into form. But Sir Ralph, like so many authors,
seemed to contradict in his person everything worth while in his
work.
His wife, Lady Incledon, knew him to be earnest, hard-working,
emotional, timorous. His anxiety and modesty when at bay before
the public gave the impression of conceit, contempt, and insolence.
If he had been more cocksure of his play he would not have been so
critical of its interpreters. If he had not been so afraid of the
Americans he would not have tried to make them afraid of him. No
tenderer-hearted novelist ever wrote than Dickens, yet he had the
knack of infuriating mobs of people into a warm desire to lynch him.
No sweeter-souled poet ever sang than Keats, yet Byron said he
never saw him but he wanted to kick him.
Sir Ralph Incledon had the misfortune to belong to this class. He
was not popular at home and he was maddening abroad. He made
Americans remember Bunker Hill and long to avenge Nathan Hale.
The critics felt it their patriotic duty to make reprisals for all the
Americans who had failed in London and to send this Piccadillian
back with his coat-tails between his legs.
The opening performance in New York was a first-class disaster.
The audience did not follow the London custom of calling the author
out and booing him. It left him in the wings, excruciated with
ingrowing speech. He had drawn up one of the most tactless
orations ever prepared in advance by a well-meaning author. He was
not permitted to deliver it. He had a cablegram written out to send
his anxious wife overseas. He did not send it. When he read the next
morning’s papers he was simply dazed. He had come as a missionary
direct from the capital to a benighted province and he was received
with jeers—or “jahs,” as his dialect would be spelled in our dialect.
He wept privately and then put on an armor of contempt. He
sailed shortly after, leaving the Americans marooned on their desert
continent.
The actors were treated with little mercy by most of the critics,
except to be used as bludgeons to whack the author with. Sheila’s
notices were of the “however” sort. “Miss Sheila Kemble is a
promising young actress; the part she played, however, was so
irritating—” or, “In spite of all the cleverness of—” or, “Sheila Kemble
exhausted her resources in vain to give a semblance of life to—”
Sheila sent the clippings to Mrs. Vining, and added: “Every
bouquet had a brickbat in it. We are not long for this world, I fear.”
Reben fought valiantly for the play. He squandered money on
extra spaces in the papers and on the bill-boards. He quoted from
the critics who praise everything and he emphasized lines about the
scenery. The play simply did not endure the sea change. People who
came would not enjoy it, and would not recommend it. It was hard
even to give away complimentary seats, and the result was one that
would have been more amazing if it were less common; a successful
play by a famous author produced with a famous cast at a leading
theater in the largest city of the New World was played to a theater
that could not be filled at any or no price. The receipts fell to forty
dollars one night.
A newspaper wit wrote, “Last night the crowds on Broadway
were so dense that a man was accidentally pushed into the Odeon
Theater.” On another day he said, “Last night during a performance
of Sir Ralph Incledon’s masterpiece some miscreant entered the
Odeon Theater and stole all the orchestra chairs.”
The slow death of a play is a miserable process. The actors
began to see the nobilities of the work once the author was removed
from in front of it. They regretted its passing, but plays cannot live in
a vacuum. Novels and paintings can wait patiently and calmly in
suspended animation till their understanders grow up, but plays, like
infants, must be nourished at once or they die and stay dead.

Sheila and all the company had fought valiantly for the drama.
Once Sir Ralph’s back was turned, they fell to playing their rôles their
own way, and they at least enjoyed their work more. But the
audiences never came.
Sheila was plunged into deeps of gloom. She felt that she must
suffer part of the blame or at least the punishment of the play’s non-
success. She wished she had stayed with “A Friend in Need.”
But Reben had always been known as a good sport, a plucky
taker of whatever medicine the public gave him. After a bastinado
from the critics he had waited to see what the people would do.
There was never any telling. Sometimes the critics would write
pæans of rapture and the lobby would be as deserted as a
graveyard, leaving the box-office man nothing to do but manicure
his nails. Sometimes the critics would unanimously condemn, and
there would be a queue at the door the next morning. Sometimes
the critics would praise and the mob would storm the window.
Sometimes they would blame and audiences would stay away as if
by conspiracy. In any case, “the box-office tells the story.”
Cassard, the manager, once said that he could tell if a play were
a success by merely passing the theater an hour after the
performance was over. A more certain test at the Odeon Theater
was the manner of Mr. Chittick, the box-office man. If he laid aside
his nail-file without a sigh and proved patient and gracious with the
autobiographical woman who loitered over a choice of seats and
their date, the play was a failure. If Mr. Chittick insulted the brisk
business man who pushed the exact sum of money over the ledge
and weakly requested “the two best, please” the play was a triumph.
Mr. Chittick was a very model of affability while Incledon’s play
occupied the stage of the unoccupied theater.
Reben’s motto was “The critics can make or break the first three
weeks of a play and no more. After that they are forgotten.” If he
saw the business growing by so much as five dollars a night he hung
on. But the Incledon play sagged steadily. At the end of a week
Reben had the company rehearsing another play called “Your Uncle
Dudley,” an old manuscript he had bought years ago to please a star
he quarreled with later.
Reben talked big for a while about forcing the run; then he talked
smaller and smaller with the receipts. Finally he announced that
“owing to previous bookings it will be necessary,” etc. “Mr. Reben is
looking for another theater to which to transfer this masterwork of
Sir Ralph Incledon. He may take it to Boston, then to Chicago for an
all-summer run.”
Eventually he took it to Mr. Cain’s storage warehouse.
“Your Uncle Dudley,” appealed to Reben as a stop-gap. It would
cost little. The cast was small; only one set was required. The title
rôle fitted Brereton to a nicety. He offered Sheila the heroine, who
was a “straight.” She cannily chose a smaller part that had
“character.” The play was flung on “cold”—that is, without an out-of-
town try-out.
It caught the public at “the psychological moment,” to use a
denatured French expression. The morning after the first night the
telephone drove Mr. Chittick frantic. He almost snapped the head off
a dear old lady who wanted to buy two boxes. It was a hopeless
success.
The only sour face about the place except his was the star’s. The
critics accused Tom Brereton of giving “a creditable performance.” All
the raptures were for Sheila. She was lauded as the discovery of the
year.
The critics are always “discovering” people, as Columbus
discovered the Indians, who had been there a long while before.
Two critics told Reben in the lobby between the acts that there was
star-stuff in Sheila. He thanked them both for giving him a novel
idea: “I never thought of that, old man.” And the old men walked
away like praised children. Like children, they were very, very
innocent when they were good and very, very incorrigible when they
were horrid.
Tom Brereton behaved badly, to Sheila’s thinking. To his thinking
she was the evil spirit. He gave one of those examples of good
business policy which is called “professional jealousy” in the theater.

You might also like