96549
96549
96549
https://ebookultra.com
https://ebookultra.com/download/learn-javascript-
and-ajax-with-w3schools-1st-edition-w3schools/
https://ebookultra.com/download/ajax-creating-web-pages-with-
asynchronous-javascript-and-xml-1st-edition-edmond-woychowsky/
ebookultra.com
https://ebookultra.com/download/zk-ajax-without-javascript-
framework-1st-edition-henri-chen/
ebookultra.com
https://ebookultra.com/download/javascript-ajax-for-dummies-1-edition-
andy-harris/
ebookultra.com
https://ebookultra.com/download/practical-javascript-dom-scripting-
and-ajax-projects-1st-edition-frank-zammetti/
ebookultra.com
MooTools Essentials The Official MooTools Reference for
JavaScript and Ajax Development 1st Edition Aaron Newton
https://ebookultra.com/download/mootools-essentials-the-official-
mootools-reference-for-javascript-and-ajax-development-1st-edition-
aaron-newton/
ebookultra.com
https://ebookultra.com/download/javascript-with-promises-1st-edition-
daniel-parker/
ebookultra.com
https://ebookultra.com/download/pro-javascript-with-mootools-learning-
advanced-javascript-programming-1st-edition-mark-joseph-obcena-auth/
ebookultra.com
https://ebookultra.com/download/developing-responsive-web-
applications-with-ajax-and-jquery-1st-edition-sandeep-kumar-patel/
ebookultra.com
Learn JavaScript and Ajax with w3Schools 1st Edition
W3Schools Digital Instant Download
Author(s): W3Schools
ISBN(s): 9780470611944, 0470611944
Edition: 1
File Details: PDF, 3.57 MB
Year: 2010
Language: english
Learn JavaScript and AJAX with w3schools
®
Published by
Wiley Publishing, Inc.
111 River Street
Hoboken, NJ 07030-5774
www.wiley.com
Copyright © 2010 by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-0-470-61194-4
LOC/CIP: 2010925161
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any
form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise,
except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without
either the prior written permission of the Publisher, or authorization through payment of the appro-
priate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923,
(978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed
to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, N 07030,
(201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations
or warranties with respect to the accuracy or completeness of the contents of this work and spe-
cifically disclaim all warranties, including without limitation warranties of fitness for a particular
purpose. No warranty may be created or extended by sales or promotional materials. The advice
and strategies contained herein may not be suitable for every situation. This work is sold with the
understanding that the publisher is not engaged in rendering legal, accounting, or other professional
services. If professional assistance is required, the services of a competent professional person should
be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The
fact that an organization or Website is referred to in this work as a citation and/or a potential source
of further information does not mean that the author or the publisher endorses the information the
organization or Website may provide or recommendations it may make. Further, readers should be
aware that Internet Websites listed in this work may have changed or disappeared between when this
work was written and when it is read.
For general information on our other products and services please contact our Customer Care
Department within the United States at (877) 762-2974, outside the United States at (317) 572-
3993 or fax (317) 572-4002.
Trademarks: Wiley, the Wiley logo, and related trade dress are trademarks or registered trade-
marks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries,
and may not be used without written permission. w3schools and the w3schools logo are registered
trademarks of w3schools. JavaScript is a registered trademark of Sun Microsystems, Inc. All other
trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with
any product or vendor mentioned in this book.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print
may not be available in electronic books.
Library of Congress CIP Data is available from the publisher.
w3schools Authors/Editors
w3schools’ mission is to publish well-organized and easy-to-understand online tutorials
based on the W3C Web standards.
Hege Refsnes
Hege is a writer and editor for w3schools. She works to improve the usability and acces-
sibility of the Web.
Hege has been writing tutorials for w3schools since 1998.
Ståle Refsnes
Ståle has ten years of Internet development experience, developing all the Web-based solu-
tions for The Norwegian Handball Federation.
Ståle has been writing tutorials for w3schools since 1999.
Kai Jim Refsnes
Kai Jim has been around computers since childhood, working with them since the age
of 14.
He has been writing tutorials for w3schools since completing a bachelor’s degree in infor-
mation technology in 2005.
Jan Egil Refsnes
Jan Egil is the president and founder of w3schools.
He is a senior system developer with a master’s degree in information technology and
more than 30 years of computing experience.
“Jani” has supervised a large number of company-critical development projects for oil
companies like Amoco, British Petroleum, ELF, Halliburton, and Brown & Root. He has
also developed computer-based solutions for more than 20 governmental institutions like
The National Library, Norwegian High Schools, The State Hospital, and many others.
Jani started w3schools in 1998.
Credits
Acquisitions Editor Vice President and Executive Group
Scott Meyers Publisher
Richard Swadley
Production
Abshier House Vice President and Executive Publisher
Barry Pruett
Technical Editor
Harry Buss Associate Publisher
Jim Minatel
Copy Editor
Abshier House Project Coordinator, Cover
Lynsey Stanford
Associate Director of Marketing
David Mayhew Proofreading and Indexing
Abshier House
Production Manager
Tim Tate Cover Designer
Michael Trent
Table of Contents
Introduction..................................................1
JavaScript............................................................................................ 1
AJAX................................................................................................... 3
How To Use This Book....................................................................... 4
v
Table of Contents
vi
Table of Contents
vii
Table of Contents
viii
Table of Contents
ix
Table of Contents
x
Table of Contents
xi
Table of Contents
Appendixes...............................................203
Appendix A: JavaScript Objects........................................................................203
Appendix B: HTML DOM Objects.................................................................214
Index.........................................................245
xii
Introduction
W elcome to Learn JavaScript and Ajax with w3schools. This book is for Web site
designers and builders who want to learn to add interactivity to their Web pages
with JavaScript and Ajax.
w3schools (www.w3schools.com), is one of the top Web destinations to learn JavaScript
and many other key Web languages. Founded in 1998, w3schools’ tutorials are recom-
mended reading in more than 100 universities and high schools all over the world. This
book is a great companion to the JavaScript and Ajax tutorials on the w3schools site,
which were written by Jan Egil Refsnes, Ståle Refsnes, Kai Jim Refsnes, and Hege Refsnes.
Like the w3schools online tutorials, this book features a brief presentation of each topic,
trading lengthy explanations for abundant examples showcasing each key feature. This
book, as well as other w3schools books published by Wiley, features straight-forward and
concise tutorials on each topic from which the beginning Web developer can easily learn.
All of the book’s content is derived from w3schools’ accurate, user-tested content used by
millions of learners every month.
JavaScript
JavaScript is the scripting language of the Web. JavaScript is used in millions of Web pages
to add functionality, validate forms, detect browsers, and much more. JavaScript is the
most popular scripting language on the Internet and works in all major browsers, such as
Internet Explorer, Firefox, Chrome, Opera, and Safari.
What Is JavaScript?
8 JavaScript was designed to add interactivity to HTML pages.
8 JavaScript is a scripting language.
8 A scripting language is a lightweight programming language.
8 JavaScript is usually embedded directly into HTML pages.
Learn JavaScript and AJAX with w3schools
2
Introduction
AJAX
AJAX equals Asynchronous JavaScript and XML.
AJAX is based on JavaScript and HTTP requests. AJAX is not a new programming lan-
guage, but a new way to use existing standards.
AJAX is the art of trading data with a Web server, and changing parts of a Web page,
without reloading the whole page.
3
Learn JavaScript and AJAX with w3schools
8 HTML
8 CSS
AJAX applications are browser- and platform-independent.
This icon indicates where you will find further information about a topic that is
covered more thoroughly elsewhere within the book.
This book is divided into five sections:
8 Section I: JavaScript Basic
8 Section II: JavaScript Objects
8 Section III: JavaScript Advanced
8 Section IV: AJAX Basic
8 Section V: SectionAJAX Advanced
4
Introduction
If you’re anxious to improve your Web pages and to add some interactivity, jump right
in with JavaScript Basic. Plenty of examples and opportunities to try things await, and
w3schools will be right there when you need them!
5
Section I
JavaScript
Basic
❑ Chapter 1: JavaScript How To and Where To
❑ Chapter 2: JavaScript Statements and
Comments
❑ Chapter 3: JavaScript Variables
❑ Chapter 4: JavaScript Operators
❑ Chapter 5: JavaScript Comparisons
❑ Chapter 6: JavaScript If…Else
❑ Chapter 7: JavaScript Loops
❑ Chapter 8: JavaScript Flow Control Statements
❑ Chapter 9: JavaScript Switch and Popup Boxes
❑ Chapter 10: JavaScript Functions
❑ Chapter 11: JavaScript Events
❑ Chapter 12: JavaScript Try…Catch and Throw
Statements
❑ Chapter 13: JavaScript Special Characters and
Guidelines
7
Chapter 1
JavaScript How To
and Where To
In This Chapter
❑ How To Put a JavaScript into an HTML Page
❑ How To Handle Simple Browsers
❑ Where To Put the JavaScript
❑ Using an External JavaScript
The HTML <script> tag is used to insert a JavaScript into an HTML page.
Figure 1.1
9
Learn JavaScript and Ajax with w3schools
Here’s your first opportunity to personalize JavaScript. Change the “Hello World”
text to “Happy, Happy, Joy, Joy!” and see what happens. The result of your changes
is shown in Figure 1.2.
Figure 1.2
The following example shows how to add HTML tags to the JavaScript. The result
of this code is shown in Figure 1.3.
<html>
<body>
<script type="text/javascript">
document.write("<h1>Hello World!</h1>");
</script>
</body>
</html>
Figure 1.3
Continuing with our happier version of the code, change the “Hello World!” text
to “Happy, Happy, Joy, Joy!” and see what happens. The result of your changes is
shown in Figure 1.4.
10
Chapter 1: JavaScript How To and Where To
Figure 1.4
To insert a JavaScript into an HTML page, we use the <script> tag. Inside the
<script> tag we use the type attribute to define the scripting language.
11
Learn JavaScript and Ajax with w3schools
(continued)
</script>
</body>
</html>
NOTE If we had not typed the <script> tag, the browser would have treated
the document.write(“Hello World!”) command as pure text and would just
write the entire line on the page, as shown in Figure 1.5.
Figure 1.5
The two forward slashes at the end of comment line (//) comprise the JavaScript
comment symbol. This prevents JavaScript from executing the --> tag.
12
Chapter 1: JavaScript How To and Where To
Scripts in <head>
Scripts to be executed when they are called, or when an event is triggered, are placed
in functions.
Put your functions in the head section. This way they are all in one place, and they
do not interfere with page content. The resulting alert box is shown in Figure 1.6.
<body onload="message()">
</body>
</html>
Figure 1.6
Scripts in <body>
If you don’t want your script to be placed inside a function, or if your script should
write page content, it should be placed in the body section. Figure 1.7 shows the
result.
13
Learn JavaScript and Ajax with w3schools
<body>
<script type="text/javascript">
document.write("This message is written by JavaScript");
</script>
</body>
</html>
Figure 1.7
</html>
14
Chapter 1: JavaScript How To and Where To
Figure 1.8
NOTE Remember to place the script exactly where you normally would write the
script!
15
Chapter 2
JavaScript
Statements and
Comments
In This Chapter
❑ JavaScript Code
❑ JavaScript Blocks
❑ JavaScript Multiline Comments
❑ Using Comments To Prevent Execution
❑ Using Comments at the End of a Line
JavaScript Statements
A JavaScript statement is a command to a browser. The purpose of the command is
to tell the browser what to do.
The following JavaScript statement tells the browser to write “Hello Dolly” to the
Web page:
document.write("Hello Dolly");
It is normal to add a semicolon at the end of each executable statement. Most
people think this is a good programming practice, and most often you will see this
in JavaScript examples on the Web.
The semicolon is optional (according to the JavaScript standard), and the browser
is supposed to interpret the end of the line as the end of the statement. You often
will see examples without the semicolon at the end.
16
Chapter 2: JavaScript Statements and Comments
JavaScript Code
JavaScript code (or just JavaScript) is a sequence of JavaScript statements. Each
statement is executed by the browser in the sequence it is written.
This example will write a heading and two paragraphs to a Web page as shown in
Figure 2.1.
<script type="text/javascript">
document.write("<h1>This is a heading</h1>");
document.write("<p>This is a paragraph.</p>");
document.write("<p>This is another paragraph.</p>");
</script>
</body>
</html>
Figure 2.1
JavaScript Blocks
JavaScript statements can be grouped together in blocks. Blocks start with a left
curly bracket { and end with a right curly bracket }.
The purpose of a block is to make the sequence of statements execute together.
The following example writes a heading and two paragraphs to a Web page as
shown in Figure 2.2.
17
Learn JavaScript and Ajax with w3schools
<script type="text/javascript">
{
document.write("<h1>This is a heading</h1>");
document.write("<p>This is a paragraph.</p>");
document.write("<p>This is another paragraph.</p>");
}
</script>
</body>
</html>
Figure 2.2
The preceding example is not very useful. It just demonstrates the use of a block.
Normally, a block is used to group statements together in a function or in a condi-
tion (in which a group of statements should be executed if a condition is met).
You will learn more about functions and conditions in Chapters 6 and 10.
JavaScript Comments
JavaScript comments can be added to explain the JavaScript script or to make the
code more readable.
Single line comments start with //.
The following example uses single-line comments to explain the code.
18
Chapter 2: JavaScript Statements and Comments
<script type="text/javascript">
// Write a heading
document.write("<h1>This is a heading</h1>");
// Write two paragraphs:
document.write("<p>This is a paragraph.</p>");
document.write("<p>This is another paragraph.</p>");
</script>
</body>
</html>
Figure 2.3
<script type="text/javascript">
(continued)
19
Learn JavaScript and Ajax with w3schools
(continued)
/*
The code below will write
one heading and two paragraphs
*/
document.write("<h1>This is a heading</h1>");
document.write("<p>This is a paragraph.</p>");
document.write("<p>This is another paragraph.</p>");
</script>
</body>
</html>
Figure 2.4
<script type="text/javascript">
//document.write("<h1>This is a heading</h1>");
document.write("<p>This is a paragraph.</p>");
document.write("<p>This is another paragraph.</p>");
20
Chapter 2: JavaScript Statements and Comments
</script>
</body>
</html>
Figure 2.5
In the following example, the comment is used to prevent the execution of a code
block (can be suitable for debugging):
<script type="text/javascript">
/*
document.write("<h1>This is a heading</h1>");
document.write("<p>This is a paragraph.</p>");
document.write("<p>This is another paragraph.</p>");
*/
</script>
</body>
</html>
21
Learn JavaScript and Ajax with w3schools
<script type="text/javascript">
document.write("Hello"); // Write "Hello"
document.write(" Dolly!"); // Write " Dolly!"
</script>
</body>
</html>
Figure 2.6
22
Chapter 3
JavaScript
Variables
In This Chapter
❑ Do You Remember Algebra from School?
❑ JavaScript Variables
❑ Declaring (Creating) JavaScript Variables
❑ Assigning Values to Undeclared JavaScript Variables
❑ Redeclaring JavaScript Variables
❑ JavaScript Arithmetic
JavaScript Variables
As with algebra, JavaScript variables are used to hold values or expressions. A vari-
able can have a short name, like x, or a more descriptive name, like carname.
23
Learn JavaScript and Ajax with w3schools
N O TE There are 59 reserved words that are not legal variable names.
TIP Because JavaScript is case sensitive, variable names are case sensitive.
A variable’s value can change during the execution of a script. You can refer to a vari-
able by its name to display or change its value. Your result is shown in Figure 3.1.
<script type="text/javascript">
var firstname;
firstname="Hege";
document.write(firstname);
document.write("<br />");
firstname="Tove";
document.write(firstname);
</script>
</body>
</html>
24
Chapter 3: Javascript Variables
Figure 3.1
After the declaration shown, the variables are empty. (They have no values yet.)
However, you can also assign values to the variables when you declare them:
var x=5;
var carname="Volvo";
After the execution of the preceding statements, the variable x will hold the value 5,
and carname will hold the value Volvo.
N O TE When you assign a text value to a variable, use quotes around the value.
25
Learn JavaScript and Ajax with w3schools
(continued)
have the same effect as these:
var x=5;
var carname="Volvo";
After the execution of the preceding statements, the variable x will still have the
value of 5. The value of x is not reset (or cleared) when you redeclare it.
JavaScript Arithmetic
As with algebra, you can do arithmetic operations with JavaScript variables:
y=x-5;
z=y+5;
You will learn more about the operators that can be used in Chapter 4,
“JavaScript Operators.”
26
Chapter 4
JavaScript
Operators
In This Chapter
❑ JavaScript Arithmetic Operators
❑ JavaScript Assignment Operators
❑ The + Operator Used on Strings
❑ Adding Strings and Numbers
27
Learn JavaScript and Ajax with w3schools
After the execution of the preceding statements, the variable txt3 contains “What
a verynice day”.
To add a space between the two strings, insert a space into one of the strings:
txt1="What a very ";
txt2="nice day";
txt3=txt1+txt2;
After the execution of the preceding statements, the variable txt3 contains:
“What a very nice day”
<script type="text/javascript">
x=5+5;
document.write(x);
document.write("<br />");
x="5"+"5";
document.write(x);
document.write("<br />");
x=5+"5";
document.write(x);
document.write("<br />");
x="5"+5;
document.write(x);
document.write("<br />");
</script>
<p>The rule is: If you add a number and a string, the result
will be a string.</p>
</body>
</html>
Figure 4.1
29
Chapter 5
JavaScript
Comparisons
In This Chapter
❑ Comparison Operators
❑ How to Use Comparisons
❑ Logical Operators
❑ Conditional Operator
Comparison and logical operators are used to test for true or false.
Comparison Operators
Comparison operators are used in logical statements to determine equality or differ-
ence between variables or values.
Given that x = 5, the following table explains the comparison operators:
Operator Description Example
== is equal to value...is equal to value x == 8 is false
=== is exactly equal to value and type x === 5 is true
x === “5” is false
!= is not equal x! = 8 is true
> is greater than x > 8 is false
< is less than x < 8 is true
>= is greater than or equal to x >= 8 is false
<= is less than or equal to x <= 8 is true
30
Chapter 5: Javascript Comparisons
You will learn more about the use of conditional statements in the next
chapter.
Logical Operators
Logical operators are used to determine the logic between variables or values.
Given that x = 6 and y = 3, the following table explains the logical operators:
Operator Description Example
&& and (x < 10 && y > 1) is true
|| or (x == 5 || y == 5) is false
! not !(x == y) is true
Conditional Operator
JavaScript also contains a conditional operator that assigns a value to a variable
based on some condition. The syntax is as follows:
variablename=(condition)?value1:value2
For example,
greeting=(visitor=="PRES")?"Dear President ":"Dear ";
If the variable visitor has the value of "PRES", then the variable greeting will be
assigned the value "Dear President " else it will be assigned "Dear".
31
Chapter 6
JavaScript If...Else
Statements
In This Chapter
❑ Conditional Statements
❑ if Statement
❑ if...else Statement
❑ if...else if...else Statement
Conditional Statements
Very often when you write code, you want to perform different actions for different
decisions. You can use conditional statements in your code to do this.
JavaScript has the following conditional statements:
8 if statement. Use this statement to execute some code only if a specified condi-
tion is true.
8 if...else statement. Use this statement to execute some code if the condition is
true and another code if the condition is false.
8 if...else if....else statement. Use this statement to select one of many blocks of
code to be executed.
8 switch statement. Use this statement to select one of many blocks of code to
be executed.
32
Chapter 6: JavaScript If...Else Statements
if (condition)
statement 1;
statement 2;
statement 3;
// only statement 1 is executed
if Statement
Use the if statement to execute some code only if a specified condition is true.
The syntax is as follows:
if (condition)
{
code to be executed if condition is true
}
Your result is shown in Figure 6.1.
TIP if is written in lowercase letters. Using uppercase letters (IF) will generate a
JavaScript error!
<script type="text/javascript">
var d = new Date();
var time = d.getHours();
(continued)
33
Learn JavaScript and Ajax with w3schools
(continued)
if (time < 10)
{
document.write("<b>Good morning</b>");
}
</script>
</body>
</html>
Figure 6.1
N O TE There is no ..else.. in this syntax. You tell the browser to execute some
code only if the specified condition is true.
if...else Statement
Use the if....else statement to execute some code if a condition is true and
another code if the condition is not true.
The syntax is as follows:
if (condition)
{
code to be executed if condition is true
}
else
{
code to be executed if condition is not true
}
34
Exploring the Variety of Random
Documents with Different Content
movement you describe is. I have no fear if the people now interested
can only be kept working with some result, enough to keep up their
hope; if so, the things must grow.
Freshwater Place,
1879 or ’80.
I got two nice little letters from children, when I was away. I heard
they took my answers, and read them to the other children in the
Playground. Wasn’t it nice of them? I send you my little neighbour’s
artistic efforts; he is only a little chap. They had trained my scarlet
runners, and left everything just as it was in my room, and welcomed
me back so tenderly, saying the place had felt empty and dull without
me. A girl, who has a lot of sisters to mother, came to tell me she had
found the motto she liked best, “Love is the greatest force,” evidently
learnt from experience; for they are all so fond of her. She and four
sisters, and other little and big neighbours, came yesterday to work
for an industrial exhibition we are going to have; and whilst they did
needlework and pasting, etc., we read the “Fairy Spinner.”[92] I think
M. H. was really the only one who could listen to it, as she has been
ill and didn’t feel the excitement of the novelty so much as the others.
Some of the dear little tots kept running past crying to the swallows
and butterflies painted on the wall, “I’ll catch you bird,” “I’ll catch
you butterfly,” almost as happy, dear, as if they were real ones, I
think.... We came home to that dear Haven named Miranda, looking
so sweet and rested and full of delightful sayings and doings of other
people. Can’t you see her upturned face telling them, and a twinkle in
her eyes at something funny?
ART IN
FRESHWATER
No date. (Probably 1879.)
PLACE
From Miss Emily Harrison.
Dearest Octavia,
Oh if one could but have a penny botanical garden in the
Marylebone Road for the hot little children and weakly old people!
“Now I hope you’ll enjoy yourself,” with a hearty grasp of the hand,
as much as to say, “You must now,” was the last word I heard at
Freshwater Place.
I didn’t at all like leaving it. The children enjoyed their field day
very much, I think, and kept asking, “Wasn’t it nice on Saturday?”
with such a little hug of your hand! I was so pleased with one child,
who, I knew, in the midst of amusing herself, simply to give me
pleasure, came away to me with, “Won’t Miss like to have a game of
six acres of land?” and the girl with the dreadful face behaved
splendidly, and carried poor little Shannon all the way home to Swiss
Cottage; for we nearly killed the poor little fellow. The cab-door burst
open, and he was shot out, and I expected him to be killed on the
spot. But on Sunday he was on his legs again—quite a hero; and
instead of pitching into me, his parents were so kind; only too
anxious to reassure me, and show how well he could walk. In fact,
Johnny has come into notice ever since. I had a nice talk with grave
Mrs. Wilson, who is going to lend books, and to honour me by
getting me a cup of tea there; and I went to say, “How d’ye do?” and
“Good-bye!” to B. Court Club, and found Mrs. Lewes there.
She was so pleased to get her rents all right; but also disappointed
at many things. It seems that it is when everything looks like failure
that courage comes from some bright spot, or something to start you
afresh.
To Mrs. Shaen.
In an age when doubt assails so many young spirits with its light
destruction of belief in the eternal and intangible, will not the
possession of such a brother be perhaps to the elder ones something
no other possession could be? Those who have never loved and lost
may think of the dead as buried and done with; those whose lost ones
had nothing noble or specially characteristic which was good about
them, may think of them as having lived; but whoever has seen and
loved a being with peculiar beauty and nobleness, will have
moments, and those the best and deepest in life, when the certainty
that that being still lives, will be quite quietly triumphant over all
clever talk or brilliant flippancy. I think to you all Frank will be
always a blessing—in spite of pain.
Braemar,
September 24th, 1879.
B. Court Club,
October 18th, 1878 or 1879 (?).
Gertrude to Octavia.
Eland House,
November 3rd, 1879 or ’80.
WORK OF THE
KYRLE SOCIETY
14, Nottingham Place,
October 17th, 1879.
From Miranda.
I don’t know whether Minnie will write and give you any account
of the Kyrle Committee Meeting yesterday; but, in case she does not,
I think you will be glad to know that all went, I think, very
satisfactorily. Your letter was received with pleasure, and your offer
of transferring the St. Christopher work to the Kyrle was received
with warm thanks. Somebody is to be found to undertake the
drawing.... Can you tell me where your large St. Christopher is? I was
asked to show it yesterday, that the Committee might see how much
needed completing.
The money was voted for the choir without any difficulty. We have
two applications to decorate rooms for working girls.
Minnie asked, on behalf of the O.S. Committee, whether they were
at liberty to appeal to the public for funds without consulting the
General Committee on the subject. It was decided that they could
not. Mr. N. said that he thought they never ought to take any public
action without consulting the General Committee. We explained how
impossible it would be to work at all, if no public action could be
taken without reference to the General Committee; for all the work is
dealing with public bodies, vestries, etc., and, when Minnie pointed
out that in any doubtful case like Burnham Beeches, the O.S.
Committee always had, and always would, consult the General
Committee, Mr. N. was satisfied.
In order to bind the work in the Court (not the collecting, to which
this letter does not refer at all) and to make the arrangements
simpler and more organised, it is proposed to unite the teachers of
the evening classes into a little Committee.
I hope you will be able to join this Committee. I do not think that it
will involve you in any labour which will not be very easy, even to so
busy a person as you; while it would, in many ways, save you trouble
in making arrangements a little more organised and easy to deal
with. I think you would all enjoy the little reason for meeting from
time to time.
Unless any unforeseen business presents itself, I should think two
meetings in the year would be ample; one to settle summer and one
winter arrangements, for it is proposed to leave everyone utterly free
to do on their evening precisely what seems good to them, so that the
only questions that the Committee would have to deal with would be
those which might clash with or influence other workers, or in which
they would wish to have a voice. My sister, Mrs. Edmund Maurice,
will be Secretary of the little Committee. There would be five
members, including yourself; but if large questions of general
interest were coming before the Committee, it would be well to invite
the other workers in the Court to attend and vote, as the landlord is
anxious for the room to be as generally useful as possible, especially
as Lady Ducie has given up hers to the general use of the Court so
entirely by giving the use of it to the Club. I am not without hope that
I may have the great pleasure of seeing the Committee meet just once
here, after Xmas, before I go. I hope rather great things from it, do
you know? I feel how much the life of the Court has developed since I
left. All of you seem to me stronger and quite knowing your own
strength, which is an immense help. The work is more individual,
more living, more firmly rooted; but I don’t like to think that you
should lose anything by my absence; and I sometimes dare to hope
that this little Committee might, while leaving to each of you full, free
scope, give you each the little connecting link you seem as if you
might lose in losing me. I mean the power of all meeting for common
work, of gathering strength each from the other, of adding power and
life each to the other’s work, of knowing and meeting one another, of
understanding each what the other means, of pausing for a moment
to see if there is anything to learn, to accept, to use in the other’s
work, the sense of a common cause and of being one body to
interpret that common cause in the noblest way in which it can be
conceived, and to sink all little narrow views in the broadest and
deepest ones.
GROWTH OF
WORK IN
Rome,
OCTAVIA’S February 18th, 1880.
ABSENCE
To Miranda.
To her Mother.
... I am glad you like the Diary of an Old Soul. I think MacDonald
singularly excels in that quaint, simple, deeply religious poetry.
Somehow he has naturally the habit of making those queer
comparisons, and sudden leaps from great to small things which one
finds in the old poets; and, in the same way, his deep faith atones for
the strangeness. There is even something captivating in it. I think the
book very beautiful. I went to see Mrs. Grey in Rome. She was so
very kind and nice, and so interesting too. We talked of old times,
and of the Public Day Schools, and the Kindergarten work. We also
saw the Marshes.... Yesterday we came from Beneventum here. The
day was wild, and there was even rain; but it was very interesting,
first to cross the watershed between the Adriatic and Tyrrhenian
Seas, then to traverse the great plain lying round Foggia, where four
and a half million sheep used to graze, returning in winter by three
great roads called the Strade dei Pecore. The merino sheep used to be
there, now the plain is gradually being cultivated; but there are still
half a million sheep, and one sees herds of great grey cattle, and
droves of 40 or 60 horses, looking almost wild, grazing among the
glades of oak trees, or on the open ground.
CO-OPERATION
WITH CLERGY
February 21st, 1880.
Miranda to Octavia.
One of the lady workers was talking of giving food to one of the B.
Crt. men, who has been ill; but I found he had just got into work, so I
suggested he could get on for himself now. I then explained to her
that your plan was to let St. Thomas’s Relief Committee do any
absolute relief, and then to strengthen them with gifts, if you can
make any. She was so much interested, and very glad to know it. She
said that she had no idea you worked with the Church authorities to
that extent. She knew you were a member of the Church, but had no
idea you co-operated with the clergy to that extent. So many people
thought you chose to be independent. I explained how anxious you
were that the clergy should be willing to be co-operated with, and
told her that your desire was to work with them and so was that of
the C.O.S. if they would but be worked with.... Mr. E. writes: “Will
Mr. M. contribute to the Thirlmere Defence Fund? He may be
induced to do so when he remembers Miss Octavia Hill’s words”
(evidently some words you spoke some time ago).
To her Mother.
CONDITION OF
PATRAS
Athens,
February 28th, 1880.
To Miranda.
To her Mother.
Athens,
March, 1880.
Octavia to Miranda.
Something has set the girls out of tune. I know how trying it is, and
how the sense of it shuts one up, and makes it impossible to be
oneself, or to trust to them. But I believe, if one could remember at
such times what depths of better things there are in every human
heart, and how they only need to be believed in and appealed to
(especially in these young things), to spring up and grow and thrive,
one would more quickly get past these trying times. There is usually
either some stupid misconception, or false standard of what is
desirable, confusing the young mind, some phantom, which seems
good to it, and is not good; or else some real evil, which the child
herself knows to be evil, and against which she—the better self—will
side with you the teacher, if you can but assume that she is ready to
do so. One may beat about the bush for any length of time, by dealing
with manifestations of wrong; but if one can get near people, and get
their spirits into harmony with God’s will and purpose, and make
them feel that one only wants that done, one strikes at the root of the
evil, and loses at once the sense of jar, because it is lost in the sense
of harmony with the good in people.
GREEK SCENERY
Hôtel des Étrangers, Athens,
March 10th, 1880
To her Mother.
... I suppose this will reach you a little before your birthday (tho’
that seems hardly credible); let it bring you my loving wishes for all
that is brightest and best. We went on Saturday to Tatoë, which is a
little place on Mt. Parnes, where the king has built a little place for
summer. It is close to the old pass of Dekelea, which the Spartans
fortified, and held during the Peloponnesian War. It was a glorious
day, and we thoroughly enjoyed it; Mt. Pentelicus looked quite
beautiful. There is a great quantity of fir wood near the king’s place.
They have cleared away trees here and there; I fancy, to let one see
the giants of the native forest, which stand magnificently, throwing
their arms up in the sunshine, a foreground to the blue mountains.
The ground was covered with wild golden crocuses, blue anemones;
and, here and there, if a little bit of land was sown with corn, there
were great crimson anemones growing among it. The utter solitude
of the country is so strange here. One drives for miles, and hardly
sees a creature. We drove on Monday to the Bay of Phalerum, and
spent the afternoon at the Acropolis, and saw the sunset from there.
Yesterday a wild, tearing wind arose. We were to to have gone to
Phyle, and the mules had been sent on; but the storm of wind raged,
so we did not attempt it; in fact we could hardly stand on the hill of
Areopagus, or beat our way back along the streets, when we returned
from seeing the theatre of Dionysius, and the Stadium. We spent
Sunday evening at Mrs. Corbett’s, and last evening at Mrs. Finlay’s,
and met Mr. and Mrs. F. Noel. They go to Eubœa soon, and we shall
follow soon.... As I sit, I see the snow heavily falling between me and
the cypress trees. It does look so out of place.... Every one agrees in
one united testimony as to the extinction of brigandage.... Here it is
pretty to watch the restored confidence, and the life that is able to
grow up under it. They seem to be very cautious still, and send
mounted gendarmes out over all these solitary roads; but it is nice to
hear the pride with which the gendarme tells you you can go
anywhere.... People are beginning to build little houses in the
country, and there are other marks of confidence. How interesting it
is to hear, on all sides, of the love of education! It seems quite innate;
the children clamour to be taught, and especially do they delight in
politics. They had no toys till lately. Old Mrs. Hill, who first
established schools here for girls, forty years ago, says she never sees
the toy-shops without remembering how she brought the first dolls
to Athens, and tried to teach the children to play. She says they all sit
down to read; boys and girls stand at the corners to discuss politics.
Children used to walk from Eleusis and back to attend school here.
GREEK POLITICS
Athens,
March 18th, 1880.
To her Mother.
We saw, some few hundred yards from the hamlet, an old, broken
marble pillar placed there to mark from the surrounding hilly open
common a tiny space separated by a rough ridge of earth from the
common; but even the ridges had gaps in them, one of which led to a
stony path. We followed it, and found ourselves in the churchyard. A
few graves, marked with little crosses, and planted with sweet
rosemary, gathered round one which alone had a stone, a little
railing, and a young date-tree planted at each corner. To our
astonishment, we found the inscription in French. It was: “Oh you
who pass by, pause and know that here lies an angel who waits for
thee beyond there, Beatrice B.... who died in her 15th year, 1877.” It
was so simple, and, having no surname, seemed to mark this more.
We wondered whether French people were the cultivators, and what
was the history. The people were all Greeks at the house doors in the
hamlet, and we don’t know enough Greek to ask who has begun the
cultivation. Still, we are getting on fast with our Greek. We often wish
we knew more. There is an exciting ministerial crisis here—M.
Tricoupis, the Liberal candidate, trying to overthrow, on financial
questions, M. Koumondouros, the Conservative. People say M.
Tricoupis is the man of most principle, but that he has not a strong
party. Some of the deputies stay at this hotel, and every night at
dinner they have a hot argument; but we cannot even follow the
main drift—we only catch a few words here and there. If we knew
more, we should learn much more. We have had a Greek master
every night, and have been learning the grammar, when Miss Y.
would let me; but it is slow work till one gets to the point of hearing.
To Miranda.
... There seems so much to tell you of what we see here. I feel
always as if I ought to dash into a sort of swift summary of journal,
instead of writing, as I should like, about all the things you tell me. I
am sure you know how my heart and thoughts follow you all in them,
and I think you will like to know many things I am seeing.
A SYMPATHETIC The weather has been so wild and wintry
TEACHER that we are glad to be settled here, and shall
not move till it is assured spring time. Meanwhile, we are seeing
things within a drive, learning Greek, and trying to gather what we
can about modern Greek life. Yesterday we went to see Mrs. Hill’s
day school for girls. Dr. and Mrs. Hill came here nearly fifty years
ago; their work has been supported by the Americans. This school
was the first house built in Athens among the hovels. They used some
foundations of an ancient market, and say the steps of the school,
which were found when they were digging the foundations, may be
those up which St. Paul stepped. Dr. and Mrs. Hill built their own
house at the same time; and it stands in quite the poor part of
Athens, the palace and all the better houses being later, and forming
a new quarter. Dr. Hill is now quite blind, and Mrs. Hill too old to
teach; but a vigorous and most sympathetic Scotch lady, Miss Muir,
lives with them, and carries on their work. I was delighted with her;
she and they seem to have been animated with the true spirit of trust
in the people, love for them, and desire, not to proselytise, but to
work with all that is good and pure in what the people themselves
believe—to strengthen that, instead of dwelling on differences. Hence
they have never found any difficulty in working with the Greek
priests. The lady who was with us kept pressing difficulties upon
Miss Muir, and asking her if she was not hampered by this or that;
and it was very beautiful to hear her answers. “Have you not great
difficulties in not being allowed to read the Bible?” “No,” said Miss
Muir; “we read it from end to end if we wish.” “But how about the
Greek doctrine and the procession of the Holy Ghost?” “O, the
Filioque! we haven’t to touch upon it any way! Do you know there is
a little school at the foot of Mount Parnes, from which the priest
wrote, asking if we could spare any old spelling books, or maps, or
school things, and we gathered together what we could; since which,
we have always been interested in the school. And some time ago the
priest said they would like some copies of the Bible. I wrote to
America, and they sent out twelve copies of the New Testament.
Twelve of the elder lads and the priest walked all the way to Athens
one day, in pouring rain, to receive these. Some months after they
wrote to say that, in reading the New Testament, so many questions
came up for which they wanted to refer to the Old Testament. ‘Might
they have the Pentateuch?’ So I wrote to America again. When the
books came, I drove to Parnes to take them. The priest was absent for
a few hours; on his return he rang the great village bell, and all the
peasants assembled, and the great boys came forward to receive their
books, and I wrote their names in them. ‘Tell me,’ I said, ‘is it true
that you read these? So many people say you don’t.’ ‘Every day,’ he
answered, ‘we have our food of necessities, and something to give it a
relish; so daily we have our lessons, and something to give them a
relish.’ Many missionaries tell the people they should not cross
themselves. To me,” she said, “it is beautiful to see them do it, when I
remember what centuries they have lived under the Turks, as a
despised and oppressed nation, and think what it must have cost
them to make that cross publicly, as they do when they pass a
church. It is the assertion of their Christianity. I sometimes ask
myself how many of us would have power to make that cross?”
“But aren’t you obliged to have a priest come in and teach?” “No,”
said Miss M.; “many come in as friends, and we always invite those
we know to the examinations and gatherings; and we have a large
number of priests’ children as scholars, but in this school we never
had a priest to teach. In Mrs. Hill’s other school she often had a
young deacon as pupil teacher. She used to prepare her Bible lessons
with him. They are very ignorant, and were delighted to learn and
then teach.”
All the human sympathy was so quick and so deep. She showed a
tiny orphan boy of 4, left by his mother, at her death, whom they
placed in school, to live with the teacher. We asked for a Greek
teacher, and she recommended one of two orphan pupil teachers, to
whom they had given rooms in the building. All the education in
Greece, of rich and poor, was initiated by Dr. and Mrs. Hill. They
have still this school of 700 boys and girls, and train their own
teachers; but the larger work they helped the Government to start,
and then gave it up to them.... I wonder what will be done about the
unveiling of St. Christopher. They are not Lady Ducie’s houses, you
see. I should like a little ceremony; but it is difficult to imagine a
simple natural one, and there seems no place for it.
CHARACTER OF
TRICOUPIS
Athens,
March 25th, 1880.
To her Mother.
UNVEILING ST.
CHRISTOPHER
Athens,
March 26th, 1880.
To Miranda.
Athens,
April 1st, 1880.
THE GROWTH OF
THE GREEK
Athens,
NATION April 8th, 1880.
To Miranda.
We went yesterday to Phyle, and saw the actual fortified place held
by Thrasybulus against the 30 tyrants. The gigantic walls still stand.
We went with Miss Muir, who is so friendly and delightful with all
the people, it is beautiful to see. It reminds me of going about with
Miss Cons. She always finds out all about the people and finds
helpful things to do for them; and it makes one see all the gentle,
helpful, friendly, hospitable side. It is so different from going about
with guides. We had such a glorious day. We drove for 10 miles over
a very bad road to a village called Chassia, quite up in a ravine of
Parnes. There the road stopped, and I had a mule, and we went for
2½ hours into the folds of the mountain ravines, till we came to the
great promontory-like rock. The utter solitude, the exquisite blue of
the shadows on the gigantic cliff-like rocks, the clear sun-filled air,
the fresh breeze, the far away look of plain or hill or bay alive with
noble memories filled me with a strange awed joy. I am much
touched with the nation. I am afraid I shall never tell you all that
makes me feel towards them as I do. I am getting such a vivid
impression of the people, its hopes and admirations, and capacities.
It is clearly growing. I have been reading a great many official
statistics, which show the wonderful growth. I cannot but believe it
has a great future. I sometimes think of Matthew Arnold’s ideas
about Hellenism, and wonder whether in very deed the people may
be destined to bring out that side of human nature he speaks of as so
wanting in the “Hebrew”;—the sort of intellectual grasp and
reverence for thought and intangible things. Yet the nation has hard
work just now with its tangible things, and is working to get them
into order. Also it has, in its suffering under the Turks, clung with
tenacity to its Christian faith, which is more than life to it; and this
feeling is intensified by the faith being connected with the nation, the
early martyrs for national freedom being many of them bishops. We
were present in the metropolitan church at the anniversary of Greek
independence. The king and the children were there. It was strange
to see the tremendous crowd, the solitary Lutheran king, the tiny
children standing between him and the people crossing themselves,
and the gorgeously dressed priests who seem so human and so near
the people compared with the Catholic clergy. With respect to the
national worship for an idea—THE families who are considered great
here are those who have lost their all at Missolonghi, or in supplying
ships from Hydra!
Athens,
April 8th, 1880.
To her Mother.
... How delighted you will be about the elections! Is it not really
marvellous; I never expected it! It is strange sometimes how silent
England is, and yet how her heart rings true! I am filled with
prayerful, almost tremulous, hope that the new Government will live
up to a high standard. Oh! do you think it will? It is pathetic to see
how happy the Greeks are about it, and how much they hope from
England now. Sometimes I fear the Liberals will not have courage to
tax to meet past expenditure quickly, as they ought; or to deal
generously with the little struggling nationalities. Those I shall feel
the test questions for them, as to their consciences. I believe they will
deal with the question of land, which will be good. The Barnetts are
here, and Mr. B. very much interested about the elections in
England.... Mr. B.’s whole heart is at home, and in talking of it....
COURTESY OF
GREEK
Corinth,
WORKMEN Sunday, April 11th, 1880.
To Her Mother.
We started on our travels again yesterday, and seem to have seen a
great deal. We drove from Athens to Megara yesterday—we being
Miss Yorke, Miss Muir, a very nice Swiss lady, and myself. We were
received and entertained by a hand-loom weaver, who knew Miss
Muir. They were so kind; they gave up to us a large room, their best,
and all slept in their second room, which led thro’ ours. Our beds
were spotlessly clean, but laid on the earthen floor, after we had all
had supper together, father, mother, married son and his wife, and
half the village looking on. I never saw more affectionate welcome, or
more native courtesy than they all showed. The son and his young
wife spent the afternoon taking us to call on their friends and
relations. It was so touching and beautiful; the very poorest people
receiving us with such a dignified bearing; and everywhere we had to
take something. One old woman, the mother of 12 children, and
quite poor, was quite distressed she had nothing but some figs and
nuts to give us. She remembered the time of the Turks and the
dreadful hardships. Our host had come out of Thessaly to be in “free
Greece,” after it was known that Thessaly was not to belong to
Greece. “Oh”! he said, “they brought the children away in boxes, or
anything, to get them safe into Greece.”
Megara is a populous village, almost entirely composed of houses
of one room only. The people wear the most lovely costume, and
carry themselves magnificently, so that every group forms a picture.
There was nothing pretty in the old houses, so I am glad to hear they
were beginning to build themselves better ones. We saw more of
their life than we could have seen anyhow else, and heard more of
their sayings. I shall just jot down a few, anyhow, to be sure to tell
you. They never speak harm of anything, especially in the evening.
They call the worst bit of a road Kali Scali, Kali meaning good; and in
the evening they respectfully call vinegar “the little sweet thing.”
Many of their expressions are formed from agricultural work. When
Miss Muir’s glove was lost they were much distressed, and said
someone must have “reaped” it. The bride and bridegroom are
married in crowns which are framed and hung up; and when they die
they are buried in them. The sons have to marry in regular order of
age, and must not do so till their sisters are married off. The boys and
girls—mere children—never stand together; the most eager crowds of
lookers-on yesterday sorted themselves, the boys being on one side,
and the girls on the other. They speak very freely to those above them
in rank, our host kept addressing Miss Muir: “Oh, sister, what sayest
thou?” tho’ the you is well distinguished from “thou.” There is no
water in the village, but a large washing place outside it—great stone
troughs by the spring; every girl, when she marries, has to receive
one as part of her dowry. The unmarried girls wear a complete skull-
cap made of half drachmas, about sixpence each; they never wear the
cap after marriage, and never unthread it for use, unless in dire need.
These people gave us food, lodging, and all their time, and turned out
of their room, and would not hear of receiving anything. As we came
along to-day, we met a flock of sheep with lambs; and Miss M. heard
the muleteers tell the shepherd to wait till they came back, as they
must take the Paschal lamb back for our host’s family. So we united
to send the lamb back as a present. The people are all rigidly fasting;
their Lent is not over. Not a man will touch any meat we offer him. At
Easter every family buys a lamb, fattens and kills it. We had a sort of
royal reception; the priest, the demarch, the schoolmaster, and all
the people coming down. Here we four, utter strangers, rode up
dusty and tired, sent in to the banker here a letter of introduction for
Mr. Dufour, and all four were instantly received, lodged, and fed as a
matter of course.
GREEK EASTER
FEASTS
Patras,
April 12th, 1880.
Pyrgos,
April 14th, 1880.
To her Mother.
Achmetaga, Eubœa,
April 24th, 1880.
... I must try to tell you something of all we have been seeing. We
left Athens on Tuesday at five o’clock in the morning, having engaged
a carriage to take us to Thebes. It was an exquisite morning, and we
drove by Eleusis thro’ a pass of Cithæron, supposed to be that of
Eleuthera. We saw the ruins of the fortress of the ancient Greeks
guarding the Attic end of the pass. As we came down on the Bœotian
side, a magnificent view of Parnassus opened on our left; the site of
Platæa was in sight; but nothing remains to mark it, as seen from a
distance; far away to the East we saw the grand snow-covered range
of mountains in Eubœa, and the beautiful peak of Delphi (Delphi in