100% found this document useful (9 votes)
51 views

Instant download jQuery 1 3 with PHP 1st Edition Kae Verens pdf all chapter

Verens

Uploaded by

kobbeasharwh
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 (9 votes)
51 views

Instant download jQuery 1 3 with PHP 1st Edition Kae Verens pdf all chapter

Verens

Uploaded by

kobbeasharwh
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/ 42

Download the full version of the ebook at ebookname.

com

jQuery 1 3 with PHP 1st Edition Kae Verens

https://ebookname.com/product/jquery-1-3-with-php-1st-
edition-kae-verens/

OR CLICK BUTTON

DOWNLOAD EBOOK

Download more ebook instantly today at https://ebookname.com


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

Pro PHP and jQuery 1st Edition Jason Lengstorf

https://ebookname.com/product/pro-php-and-jquery-1st-edition-jason-
lengstorf/

ebookname.com

Pro PHP and jQuery 1st Edition Jason Lengstorf

https://ebookname.com/product/pro-php-and-jquery-1st-edition-jason-
lengstorf-2/

ebookname.com

jQuery 1 4 Reference Guide 1st Edition Karl Swedberg

https://ebookname.com/product/jquery-1-4-reference-guide-1st-edition-
karl-swedberg/

ebookname.com

Exploring the Biological Contributions to Human Health


Does Sex Matter Institute Of Medicine

https://ebookname.com/product/exploring-the-biological-contributions-
to-human-health-does-sex-matter-institute-of-medicine/

ebookname.com
Law s relations a relational theory of self autonomy and
law First Issued As Paperback Edition Nedelsky

https://ebookname.com/product/law-s-relations-a-relational-theory-of-
self-autonomy-and-law-first-issued-as-paperback-edition-nedelsky/

ebookname.com

Microsoft System Center Network Virtualization and Cloud


Computing 1st Edition Microsoft Corporation

https://ebookname.com/product/microsoft-system-center-network-
virtualization-and-cloud-computing-1st-edition-microsoft-corporation/

ebookname.com

International Dictionary of Psychoanalysis 1st Edition


Alain De Mijolla

https://ebookname.com/product/international-dictionary-of-
psychoanalysis-1st-edition-alain-de-mijolla/

ebookname.com

Diversity and Equality The Changing Framework of Freedom


in Canada 1st Edition Avigail Eisenberg

https://ebookname.com/product/diversity-and-equality-the-changing-
framework-of-freedom-in-canada-1st-edition-avigail-eisenberg/

ebookname.com

Substituting Ingredients 4E The A to Z Kitchen Reference


4th Edition Becky Sue Epstein

https://ebookname.com/product/substituting-ingredients-4e-the-a-to-z-
kitchen-reference-4th-edition-becky-sue-epstein/

ebookname.com
Oxford International Primary Geography Student Book 3
Terry Jennings

https://ebookname.com/product/oxford-international-primary-geography-
student-book-3-terry-jennings/

ebookname.com
jQuery 1.3 with PHP

Enhance your PHP applications by increasing their


responsiveness through jQuery and its plugins

Kae Verens

BIRMINGHAM - MUMBAI

This material is copyright and is licensed for the sole use by JEROME RAYMOND on 30th October 2009
125 Louis ST, , So. Hackensack, , 07606
jQuery 1.3 with PHP

Copyright © 2009 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of
the information presented. However, the information contained in this book is sold
without warranty, either express or implied. Neither the author, Packt Publishing,
nor its dealers or distributors will be held liable for any damages caused or alleged to
be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.

First published: October 2009

Production Reference: 1211009

Published by Packt Publishing Ltd.


32 Lincoln Road
Olton
Birmingham, B27 6PA, UK.

ISBN 978-1-847196-98-9

www.packtpub.com

Cover Image by Louise Barr ([email protected])

This material is copyright and is licensed for the sole use by JEROME RAYMOND on 30th October 2009
125 Louis ST, , So. Hackensack, , 07606
Credits

Author Editorial Team Leader


Kae Verens Gagandeep Singh

Reviewers Project Team Leader


Akash Mehta Lata Basantani
Ashok Modi
Project Coordinator
John K. Murphy
Srimoyee Ghoshal

Acquisition Editor
Proofreader
Douglas Paterson
Chris Smith

Development Editor
Indexer
Darshana D. Shinde
Rekha Nair

Technical Editor
Production Coordinator
Ishita Dhabalia
Dolly Dasilva

Copy Editor
Cover Work
Sanchari Mukherjee
Dolly Dasilva

This material is copyright and is licensed for the sole use by JEROME RAYMOND on 30th October 2009
125 Louis ST, , So. Hackensack, , 07606
About the Author

Kae Verens lives in Monaghan, Ireland with his wife Bronwyn and their two kids
Jareth and Boann. He has been programming for twenty years, fifteen of which were
as a professional.

Kae started writing in JavaScript in the mid nineties, and started working on
the server-side languages a few years later. After writing CGI in C and Perl,
Kae switched to PHP in 2000, and has worked with it since then.

Kae is currently the secretary of the Irish PHP Users' Group, http://php.ie/,
is part-owner of the Irish web-development company Webworks.ie,
http://webworks.ie/, and is the author of popular web-based file-manager KFM,
http://kfm.verens.com/.

In his spare time, Kae plays the guitar, juggles, is learning to play the piano, and likes
to occasionally dust the skateboard off and mess around on it.

I would like to thank Packt Publishing for considering me for this


project; it's been a journey, and I've learned quite a lot from it. I
would also like to thank Webworks.ie for hiring me way back in
2001, when I was a brash programmer, eager to show how things
should be done. And finally, I'd like to thank Bronwyn and the kids
for putting up with the days and hours that I've had to avoid them to
concentrate on the book!

This material is copyright and is licensed for the sole use by JEROME RAYMOND on 30th October 2009
125 Louis ST, , So. Hackensack, , 07606
About the Reviewers

Akash Mehta is a web application developer and technical author based in


Australia. His area of work covers e-learning solutions, information systems, and
developer training. He regularly writes web development articles for Adobe, CNet,
the APC Magazine, and other print and online publications. He is a regular speaker
at IT conferences, user groups, and BarCamps. Currently, Akash provides various
services like web development, technical writing, consulting, and training through
his website, http://bitmeta.org/.

Hailing from an igloo somewhere up in Canada, Ashok Modi is currently a systems


analyst for California Institute of the Arts (http://calarts.edu/). He was a systems
(and games) programmer for zinc Roe Design (http://www.zincroe.com/), and
has been working with Drupal for the last three years. Starting from Drupal 4.6, he
is the author of the abuse module (and looking for co-maintainers!), and has helped
many maintainers in updating their contributed modules from 4.7.x to 5.x to 6.x. He
also helped organize DrupalCamp Toronto in 2007 and 2008 and recently presented
multiple sessions at DrupalCamp LA in 2009. In his spare time, Ashok tries to help
contributed module maintainers with features and bugs. He was a technical reviewer
on another book, Drupal 6 Social Networking, also published by Packt Publishing.

I would like to thank my wife, Richa, for letting me obsess over


technology and pushing me to freelance and try other open-source
technologies in my spare time.

John K. Murphy is a graduate of the University of West Virginia and has been
wrapped up in computers and software development since the 1980s. When he is not
buried in a book or jumping out of an airplane, he works as an IT consultant.

John lives with his wife and two children in Pittsburgh, PA and is currently
obsessing about the Internet of Things.

This material is copyright and is licensed for the sole use by JEROME RAYMOND on 30th October 2009
125 Louis ST, , So. Hackensack, , 07606
This material is copyright and is licensed for the sole use by JEROME RAYMOND on 30th October 2009
125 Louis ST, , So. Hackensack, , 07606
Table of Contents
Preface 1
Chapter 1: Introduction and Overview 7
Expected developer skills 8
Differences between PHP and JavaScript 9
What is jQuery? 10
Why jQuery? 12
How does jQuery fit in with PHP? 13
How to work with the examples 14
Projects that use PHP and jQuery 16
WordPress 16
RoundCube 16
KFM 17
Drupal 18
Summary 18
Chapter 2: Quick Tricks 19
Dynamic select boxes 21
Client-side code 22
How it works 23
Server-side code 25
Quick deletes 26
Client-side code 27
Server-side code 30
Contextual help 31
Inline editing 36
Client-side code 36
Server-side code 41
Summary 41

This material is copyright and is licensed for the sole use by JEROME RAYMOND on 30th October 2009
125 Louis ST, , So. Hackensack, , 07606
Table of Contents

Chapter 3: Tabs and Accordions 43


Using a jQuery tab plugin 44
Client-side code 45
Server-side considerations 49
Using jQuery accordion plugins 49
Client-side code 50
Server-side management of accordions 53
Client-side code 54
Server-side code 55
Just the conversion 56
Now show the data with the accordions 57
Server-side management of tabs 58
Server-side code 58
Just the conversion 59
Now show the data with the tabs 60
Using special codes to define tabs 61
Client-side code 63
Server-side code 63
Loading accordion panels through Ajax 66
Client-side code 67
Server-side code 69
Loading tab panels through Ajax 69
Client-side code 69
Summary 71
Chapter 4: Forms and Form Validation 73
Using the jQuery validation plugin 74
Client-side code 74
Setting up jQuery validation from PHP 77
Server-side code (setup) 77
Client-side code 78
Server-side code 79
Remote validation 81
Server-side code (setup) 81
Client-side code 82
Server-side code 83
Large select boxes 84
Client-side code 85
Server-side code 86

[ ii ]

This material is copyright and is licensed for the sole use by JEROME RAYMOND on 30th October 2009
125 Louis ST, , So. Hackensack, , 07606
Table of Contents

Auto-suggestion 87
Client-side code 88
Server-side code 89
Client-side code 90
Summary 91
Chapter 5: File Management 93
Security 93
Choosing a directory 95
Client-side code 95
Server-side code 97
Creating, renaming, and deleting
directories 100
Client-side code 100
Server-side code 104
Moving directories 105
Client-side code 105
Server-side code 108
File uploads 109
Client-side code 109
Server-side code 112
Renaming, deleting, and moving files 113
Client-side code 114
Server-side code 115
File downloads 116
Client-side code 116
Server-side code 117
Summary 118
Chapter 6: Calendars 119
Displaying the calendar 120
Creating an event 121
Client-side code 122
Server-side code 124
Loading events from the server 126
Client-side code 126
Server-side code 127
Moving and resizing events 128
Client-side code 128
Server-side code 129

[ iii ]

This material is copyright and is licensed for the sole use by JEROME RAYMOND on 30th October 2009
125 Louis ST, , So. Hackensack, , 07606
Table of Contents

Editing events 129


Client-side code 130
Server-side code 132
Deleting events 132
Client-side code 133
Server-side code 134
Walk-through of the calendar so far 134
Recurring events 136
Client-side code 136
Server-side code 139
Deleting recurring events 141
Client-side code 141
Server-side code 142
Summary 143
Chapter 7: Image Manipulation 145
Showing the list of images 146
Server-side code 146
Client-side code 148
Selecting an image 149
Client-side code 149
Server-side code 150
Preparing your PHP 151
Rotating 152
Client-side code 152
Server-side code 154
Caching or saving the image 155
Client-side code 156
Server-side code 157
Resizing 159
Client-side code 160
Server-side code 162
Cropping 163
Client-side code 163
Server side 166
Summary 167

[ iv ]

This material is copyright and is licensed for the sole use by JEROME RAYMOND on 30th October 2009
125 Louis ST, , So. Hackensack, , 07606
Table of Contents

Chapter 8: Drag and Drop 169


Sorting simple lists 169
Client-side code 170
Server-side code 173
Client-side code 173
Sorting trees 175
Client-side code 175
Server-side code 181
Connecting lists 182
Client-side code 183
Server-side code 185
Summary 185
Chapter 9: Data Tables 187
Setting up DataTables 188
Client-side code 188
Getting data from the server 191
Client-side code 192
Server-side code 193
Caching your database queries 195
Server-side code 196
Pagination through Ajax 197
Client-side code 198
Server-side code 198
Sorting by column 200
Filtering 201
Server-side code 201
Setting a delay on the filter 203
Summary 204
Chapter 10: Optimization 205
Optimizing the page load 206
Place scripts at the bottom 206
Aggregate and cache your scripts 207
Output HTML similar to the post-jQuery code 208
Optimizing development and maintenance 208
Writing your own plugins 209
Un-caching your JavaScript 211

[v]

This material is copyright and is licensed for the sole use by JEROME RAYMOND on 30th October 2009
125 Louis ST, , So. Hackensack, , 07606
Table of Contents

Optimizing jQuery 212


Use Google's CDN 212
Caching jQuery objects 214
Use $.load for non-visual code 216
JavaScript optimizations 216
Chaining 216
Speeding up selectors 217
Inject multiple elements at once 218
Using setTimeout 219
Use var for your variables 221
Summary 223
Index 225

[ vi ]

This material is copyright and is licensed for the sole use by JEROME RAYMOND on 30th October 2009
125 Louis ST, , So. Hackensack, , 07606
Preface
Creating PHP applications that respond quickly, avoid unnecessary page reloads,
and provide great user interfaces, often requires complex JavaScript techniques.
Even then, if you get that far, the results might not work across different browsers!
With jQuery, you can use one of the most popular JavaScript libraries, forget about
cross-browser issues, and simplify the creation of very powerful and responsive
interfaces—all with the minimum of code.

This is the first book in the market that will ease the server-side PHP coder into the
client-side world of the popular jQuery JavaScript library.

This book will show you how to use jQuery to enhance your PHP applications,
with many examples using jQuery's user interface library jQuery UI, and other
examples using popular jQuery plugins. It will help you to add exciting user
interface features to liven up your PHP applications without having to become
a master of client-side JavaScript.

This book will teach you how to use jQuery to create some really stunning effects,
but without you needing to have in-depth knowledge of how jQuery works. It
provides you with everything you need to build practical user interfaces, for
everything from graphics manipulation and drag-and-drop to data searching, and
much more. The book also provides practical demonstrations of PHP and jQuery and
explains these examples, rather than starting from how JavaScript works and how it
is different from PHP.

By the end of this book, you should be able to take any PHP application you
have written, and transform it into a responsive, user-friendly interface, with
capabilities you would not have dreamed of being able to achieve, all in just a few
lines of JavaScript.

This material is copyright and is licensed for the sole use by JEROME RAYMOND on 30th October 2009
125 Louis ST, , So. Hackensack, , 07606
Preface

What this book covers


Chapter 1, Introduction and Overview, introduces you to what jQuery is,
why you would want to use it, and why is it useful to combine it with PHP.
Also, it gives a list of projects illustrating uses for combining PHP and jQuery.

Chapter 2, Quick Tricks, looks at a few quick examples on how to interface PHP
and jQuery and a few tricks, which demonstrate how to relieve the most obvious
resource wastes on the server.

Chapter 3, Tabs and Accordions, walks through the creation of tabs and accordions
using the jQuery UI project, managing tabs and accordions using a rich text editor
and a bit of PHP, and using Ajax to populate your accordion and tab panels.

Chapter 4, Forms and Form Validation, explores form validation using jQuery
and PHP and how to use the same PHP configuration to validate on both
sides—the server and the client side. It also covers examples on optimization
of large select boxes and building auto-suggest fields.

Chapter 5, File Management, teaches you to manage almost everything—creating,


uploading, editing, moving, downloading, and deleting files and directories.

Chapter 6, Calendars, builds a weekly calendar for you, which has events that can be
created, edited, moved around, and deleted. It also takes care of recurring events.

Chapter 7, Image Manipulation, discusses methods for manipulating images with


jQuery and PHP, along with some ways to make the changes non-destructive,
so that multiple manipulations, such as select, rotate, resize, and crop, can be
made on the same image.

Chapter 8, Drag and Drop, demonstrates a few uses of drag and drop, including
sorting lists, dragging between lists, and hierarchical sorting, which can be used to
improve the usability of your content management system.

Chapter 9, Data Tables, builds a very large data table and discusses how to navigate,
sort, search, paginate, and search it using jQuery and Ajax.

Chapter 10, Optimization, shows the ways to optimize jQuery and various other
elements of the web development environment.

[2]

This material is copyright and is licensed for the sole use by JEROME RAYMOND on 30th October 2009
125 Louis ST, , So. Hackensack, , 07606
Exploring the Variety of Random
Documents with Different Content
Royal kept at work all the time that he was talking, sliding down
more boards, over those which he had put down first, to cover the
cracks. In the mean time, it began to rain; and the thunder grew
louder and louder. The wind howled about his ears, and rattled the
boards, and made it very difficult for him to place them. At length,
just as Royal was ready to go down, and get in under his hut
himself, a sudden gust took one of his boards, the upper end of
which extended upwards farther than the rest, and blew it and three
others away from their places, and carried them out to some
distance on the grass.
Marielle and the children were frightened at the noise; but it was
now raining so fast that they did not run out. Royal soon repaired
the breach with other boards, which he placed so that the wind
should not have any advantage in getting hold of them. At length,
when all seemed secure, Royal came down from the pile, and ran in
under the shelter, with the water running down off his hat and
clothes in streams.
“Now, Royal,” said Marielle, “you have got yourself all wet through,
making us a shelter.”
“That’s no matter,” said Royal. “It is good fun for a boy to get wet.”
Just then, a terrible clap of thunder burst, and rattled over their
heads, preceded by a vivid flash of lightning. They were all alarmed
at the sound. Royal, however, said that he thought that was the
worst clap they should have, and that now the storm would soon be
over.
And so it proved. The wind soon abated, and the thunder
appeared gradually to pass away to the eastward. It continued to
rain in torrents for some time; but then they were completely
protected from it, and did not get wet at all. It was an hour before
the rain was entirely over, so that they could go out and go home.
But then the air was bright, the sun was shining, and all nature
looked refreshed. Royal felt much better pleased with having been
the protector of his party, than with having teased and troubled
them as he had done on the former day. And though Marielle did not
say any thing about it, he knew that she was pleased with him too.
Royal liked Marielle for her gentleness and patience; and she liked
him for his energy and courage.
CHAPTER XI.

THE DICTIONARY.

One evening, Lucy was playing in the parlor where her mother was
at work sewing. Lucy was sitting upon a cricket, looking over a book.
Presently she found, between the leaves of the book, a small piece
of white paper.
“O mother! I’ve found a piece of paper,” said she.
Her mother did not answer.
“I wish I had a pen and ink,” said Lucy again, in a tone
intermediate between talking to herself and to her mother; “then I
would write a letter on this piece of paper.”
“And what would you do with your letter?” said her mother.
“Why, I would play that I was the postman, and so I would carry it
about.”
Just then Lucy happened to recollect that her father was in his
room writing; and so she concluded that she would go in and ask
him to write her a letter. She accordingly rose from her seat, and
went to the door of her father’s room.
The door was open a little way, and Lucy had a great mind to go
in without knocking. But, then, she remembered that it was proper
for her to knock at her father’s door, and she accordingly did so.
Nobody answered. Then Lucy pushed the door a little, so as to open
it wider, in order to see whether her father was there.
He was not there. There was nobody there. Lucy pushed the door
open farther, and walked in.
There was a lamp burning upon a table which stood against the
window. Several books and papers were upon the table. One great
book was lying open. There was a round, black inkstand not far from
the book. It had a large, conical hole in the middle of it, which led
down to the ink; and there were several smaller holes around, near
the edge, to put the pen into. There was a pen with its point in one
of these holes, the top of it leaning over to one side.
“Now, here’s a pen and ink all ready,” said Lucy; “but where’s my
father?”
Lucy walked up to the table, and began to look at the book which
was lying open. “What a great book!” she said. “I wonder if I can
read in such a great book. Here are some big letters on the top. I
can read such big letters as these.”
There were three big letters, in two places, on the top of each
page; and Lucy began to read them.
“H-o-n,” said Lucy, reading—“H-o-n spells hon; but I don’t know
what hon means. I wonder what this book is about.”
But Lucy could not find out what it was about, and so she thought
that, as her father was away, she would take the pen and write
herself a letter. She accordingly put her paper down upon the corner
of the table, and then, reaching over the great book, she dipped the
pen carefully into the conical hole in the middle of the inkstand. She
then drew the pen very slowly and cautiously to the paper, secretly
feeling, however, all the time, that she was doing wrong.
Lucy made several marks upon her paper, and then the ink in her
pen failed. She accordingly reached back to the inkstand to get some
more. She thought that she did not dip her pen far enough down
before, and that that was the reason why the ink failed so quick.
She, therefore, this time, dipped the pen in so far that the point of it
touched the bottom of the inkstand; and so, when it came up, it was
full of ink.
It was too full of ink, in fact, so that a little drop hung from the
point just ready to fall; and very unfortunately, just as Lucy had got
the pen almost across the great book, the drop did fall, and it made
quite a large, round spot upon the middle of one of the pages.
Lucy was very much frightened at this occurrence. She put the
pen back in its place, and began to walk as fast as she could go out
of the room. In a moment, however, she reflected that, as soon as
her father came in, he would see the ink spot, and would at once
inquire who made it. So she thought that she would come and shut
the book up, and that would keep the ugly-looking blot out of sight.
She accordingly came back hastily to the table, shut the book up,
and then went immediately away.
But, notwithstanding this ingenious precaution, her mind
continued in a state of great agitation and alarm. She went back to
her cricket, and began to look over her book again; but she felt very
wretched. Finally, she came to the very wise conclusion of going
back at once, and finding her father, and telling him all about the
affair.
She put her book down upon the cricket, and went again towards
her father’s room. She found her father just going into the room,
with a large book of maps under his arm.
“Well, Lucy,” said her father, “are you coming to see me?”
Lucy walked slowly towards him, with a downcast look, but she
said nothing. “What is the matter, Lucy?” said her father.
“Why,—why,” said Lucy, in a very low and timid voice,—“the ink
has got on your great book.”
“My great book? What book?” said her father.
“Your great book on the table;—that great book.”
So saying, Lucy pointed to the book upon the table; for by this
time they had got into the room where they could see the table and
the book upon it.
“Where?” said her father. “Where is the ink?”
“Somewhere in the middle of it,” said Lucy. “But I don’t suppose I
can find it now.”
Her father took up the great book, and began turning over the
leaves; but he did not find the ink spot.
“But, Lucy,” said he, “how did you get the ink upon my book?”
“Why, father,” said Lucy, “you see, I was going to write me a letter,
and the ink wouldn’t stay in the pen.”
“Now, Lucy, that was very wrong. You ought not to come to my
table, and to take my pen and ink without leave. How big was the
blot?”
“’Twas pretty big,” said Lucy, timidly.
“I can’t find the place,” said her father. “O, now I remember. It
must have been at horizon. I was looking horizon, to see how it was
accented.”
“No, sir, it was at hon. I remember now myself; it was at hon.”
Her father made no reply, but, after turning over a few leaves, he
came at once to the place, and there, to Lucy’s utter astonishment,
there were two blots, instead of one; there was one on each page.
They were very large, too, much larger than the one which Lucy had
seen.
“Now, there are two blots,” said Lucy; “how came that other one
there?”
“Why, that was made by shutting up the book,” said her father.
“How came the book shut up?”
“Why, I shut it, sir,” said Lucy.
“What did you shut it for?” said her father.
“Because,” said Lucy, speaking in a very timid voice again, “I did
not want you to see the blot.”
“Then what did you come and tell me for?” said her father.
“Why, I thought it would be better to come and tell you,” said
Lucy.
“You first shut the book in order to conceal it, and then you
altered your mind, and so came and told me; was that it?”
“Yes, sir,” said Lucy.
“Well,” said her father, “that was honest, at any rate. And the blot,
I see, is on the very word honesty. What a curious coincidence!”
“I don’t know what you mean by coincidence,” said Lucy.
“Why, you were honest in coming to tell me of the blot, and the
blot happens to be upon the word honesty. That’s a coincidence. I
am glad you were honest; but, then, you did very wrong to come
and attempt to write with my pen. You have done me a great deal of
mischief.”
“Can’t you get the blots out, any possible way?” asked Lucy.
“No, I presume not,” he replied. “I might try an acid, however,” he
added, in a low voice, as if talking to himself.
“I wish you would, father,” said Lucy. “Do try an acid, father.”
Lucy did not know what an acid was, nor how her father was
going to attempt to remove the ink stains by means of it; but she
was very eager to have him try any thing which promised any
chance of success.
“I don’t think I can take the spots out entirely,” said her father;
“but perhaps I can change their color, so that they will not be quite
so conspicuous.”
As he said this, he took the lamp and went away, Lucy following
him. He went to a closet which was in another room, and took down
a small phial, and poured out a few drops of the liquid which was in
it, into a tea-cup. Then he got some water, and poured about a
spoonful into the tea-cup too. Then he came back with Lucy into his
own room.
“First,” said he, “we will try it upon another piece of paper.”
So saying, he took a small piece of newspaper, and made a blot
upon it about as large as those which Lucy had made in the book.
Then he held the newspaper to the fire until the blot was dry.
“Now I must make a little brush,” said he.
“How can you make a brush?” said Lucy.
Her father only said in reply, “You will see.” He went to his closet,
and took a quill out from a bunch which was there. He cut off the
top, and put the quill back, and then brought the top to the table.
Then he stripped off all the feathers except a small tuft at the end,
and that, he said, was his brush.
This brush he dipped into the tea-cup, and then very carefully
washed over the ink spot upon the newspaper. Lucy saw that it
made the spot look much more dim. Then her father washed over
the spots in the book in the same way. The spots grew faint, and
turned of a reddish color; but he could not get them out entirely.
“It looks a great deal better,” said her father, “but I cannot get
them out entirely. There they must stay forever. I shall see them a
great many times, for they are in my dictionary, and I am often
turning over the leaves. And always when I see them I shall
remember how they came there. One of them will remind me of your
heedlessness, and the other of your honesty.”
THE END.
Transcriber’s Note:
Punctuation has been standardised; hyphenation retained as
it appears in the original publication.

Page 23
put back n good order changed to
put back in good order

Page 53
a screaming, chiruping, chattering, changed to
a screaming, chirruping, chattering,

Page 91
go to mill in his sleigh changed to
go to the mill in his sleigh

Page 139
Royal and William said that changed to
Royal and Thomas said that

Page 143
you an’t any bears at all changed to
you a’n’t any bears at all

Page 145
he is’nt going changed to
he isn’t going
*** END OF THE PROJECT GUTENBERG EBOOK COUSIN LUCY AT
PLAY ***

Updated editions will replace the previous one—the old editions will
be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States copyright in
these works, so the Foundation (and you!) can copy and distribute it
in the United States without permission and without paying copyright
royalties. Special rules, set forth in the General Terms of Use part of
this license, apply to copying and distributing Project Gutenberg™
electronic works to protect the PROJECT GUTENBERG™ concept and
trademark. Project Gutenberg is a registered trademark, and may
not be used if you charge for an eBook, except by following the
terms of the trademark license, including paying royalties for use of
the Project Gutenberg trademark. If you do not charge anything for
copies of this eBook, complying with the trademark license is very
easy. You may use this eBook for nearly any purpose such as
creation of derivative works, reports, performances and research.
Project Gutenberg eBooks may be modified and printed and given
away—you may do practically ANYTHING in the United States with
eBooks not protected by U.S. copyright law. Redistribution is subject
to the trademark license, especially commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the free


distribution of electronic works, by using or distributing this work (or
any other work associated in any way with the phrase “Project
Gutenberg”), you agree to comply with all the terms of the Full
Project Gutenberg™ License available with this file or online at
www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand, agree
to and accept all the terms of this license and intellectual property
(trademark/copyright) agreement. If you do not agree to abide by all
the terms of this agreement, you must cease using and return or
destroy all copies of Project Gutenberg™ electronic works in your
possession. If you paid a fee for obtaining a copy of or access to a
Project Gutenberg™ electronic work and you do not agree to be
bound by the terms of this agreement, you may obtain a refund
from the person or entity to whom you paid the fee as set forth in
paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only be


used on or associated in any way with an electronic work by people
who agree to be bound by the terms of this agreement. There are a
few things that you can do with most Project Gutenberg™ electronic
works even without complying with the full terms of this agreement.
See paragraph 1.C below. There are a lot of things you can do with
Project Gutenberg™ electronic works if you follow the terms of this
agreement and help preserve free future access to Project
Gutenberg™ electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright law
in the United States and you are located in the United States, we do
not claim a right to prevent you from copying, distributing,
performing, displaying or creating derivative works based on the
work as long as all references to Project Gutenberg are removed. Of
course, we hope that you will support the Project Gutenberg™
mission of promoting free access to electronic works by freely
sharing Project Gutenberg™ works in compliance with the terms of
this agreement for keeping the Project Gutenberg™ name associated
with the work. You can easily comply with the terms of this
agreement by keeping this work in the same format with its attached
full Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the
terms of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.

1.E. Unless you have removed all references to Project Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project Gutenberg™
work (any work on which the phrase “Project Gutenberg” appears, or
with which the phrase “Project Gutenberg” is associated) is
accessed, displayed, performed, viewed, copied or distributed:
This eBook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this eBook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is derived


from texts not protected by U.S. copyright law (does not contain a
notice indicating that it is posted with permission of the copyright
holder), the work can be copied and distributed to anyone in the
United States without paying any fees or charges. If you are
redistributing or providing access to a work with the phrase “Project
Gutenberg” associated with or appearing on the work, you must
comply either with the requirements of paragraphs 1.E.1 through
1.E.7 or obtain permission for the use of the work and the Project
Gutenberg™ trademark as set forth in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is posted


with the permission of the copyright holder, your use and distribution
must comply with both paragraphs 1.E.1 through 1.E.7 and any
additional terms imposed by the copyright holder. Additional terms
will be linked to the Project Gutenberg™ License for all works posted
with the permission of the copyright holder found at the beginning of
this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files containing a
part of this work or any other work associated with Project
Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute this


electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1 with
active links or immediate access to the full terms of the Project
Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or
expense to the user, provide a copy, a means of exporting a copy, or
a means of obtaining a copy upon request, of the work in its original
“Plain Vanilla ASCII” or other form. Any alternate format must
include the full Project Gutenberg™ License as specified in paragraph
1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™ works
unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or providing


access to or distributing Project Gutenberg™ electronic works
provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project Gutenberg™


electronic work or group of works on different terms than are set
forth in this agreement, you must obtain permission in writing from
the Project Gutenberg Literary Archive Foundation, the manager of
the Project Gutenberg™ trademark. Contact the Foundation as set
forth in Section 3 below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on, transcribe
and proofread works not protected by U.S. copyright law in creating
the Project Gutenberg™ collection. Despite these efforts, Project
Gutenberg™ electronic works, and the medium on which they may
be stored, may contain “Defects,” such as, but not limited to,
incomplete, inaccurate or corrupt data, transcription errors, a
copyright or other intellectual property infringement, a defective or
damaged disk or other medium, a computer virus, or computer
codes that damage or cannot be read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for


the “Right of Replacement or Refund” described in paragraph 1.F.3,
the Project Gutenberg Literary Archive Foundation, the owner of the
Project Gutenberg™ trademark, and any other party distributing a
Project Gutenberg™ electronic work under this agreement, disclaim
all liability to you for damages, costs and expenses, including legal
fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR
NEGLIGENCE, STRICT LIABILITY, BREACH OF WARRANTY OR
BREACH OF CONTRACT EXCEPT THOSE PROVIDED IN PARAGRAPH
1.F.3. YOU AGREE THAT THE FOUNDATION, THE TRADEMARK
OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL
NOT BE LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT,
CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES EVEN IF
YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of receiving
it, you can receive a refund of the money (if any) you paid for it by
sending a written explanation to the person you received the work
from. If you received the work on a physical medium, you must
return the medium with your written explanation. The person or
entity that provided you with the defective work may elect to provide
a replacement copy in lieu of a refund. If you received the work
electronically, the person or entity providing it to you may choose to
give you a second opportunity to receive the work electronically in
lieu of a refund. If the second copy is also defective, you may
demand a refund in writing without further opportunities to fix the
problem.

1.F.4. Except for the limited right of replacement or refund set forth
in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of damages.
If any disclaimer or limitation set forth in this agreement violates the
law of the state applicable to this agreement, the agreement shall be
interpreted to make the maximum disclaimer or limitation permitted
by the applicable state law. The invalidity or unenforceability of any
provision of this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation,


the trademark owner, any agent or employee of the Foundation,
anyone providing copies of Project Gutenberg™ electronic works in
accordance with this agreement, and any volunteers associated with
the production, promotion and distribution of Project Gutenberg™
electronic works, harmless from all liability, costs and expenses,
including legal fees, that arise directly or indirectly from any of the
following which you do or cause to occur: (a) distribution of this or
any Project Gutenberg™ work, (b) alteration, modification, or
additions or deletions to any Project Gutenberg™ work, and (c) any
Defect you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new computers.
It exists because of the efforts of hundreds of volunteers and
donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project Gutenberg™’s
goals and ensuring that the Project Gutenberg™ collection will
remain freely available for generations to come. In 2001, the Project
Gutenberg Literary Archive Foundation was created to provide a
secure and permanent future for Project Gutenberg™ and future
generations. To learn more about the Project Gutenberg Literary
Archive Foundation and how your efforts and donations can help,
see Sections 3 and 4 and the Foundation information page at
www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-profit
501(c)(3) educational corporation organized under the laws of the
state of Mississippi and granted tax exempt status by the Internal
Revenue Service. The Foundation’s EIN or federal tax identification
number is 64-6221541. Contributions to the Project Gutenberg
Literary Archive Foundation are tax deductible to the full extent
permitted by U.S. federal laws and your state’s laws.

The Foundation’s business office is located at 809 North 1500 West,


Salt Lake City, UT 84116, (801) 596-1887. Email contact links and up
to date contact information can be found at the Foundation’s website
and official page at www.gutenberg.org/contact

Section 4. Information about Donations to


the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission of
increasing the number of public domain and licensed works that can
be freely distributed in machine-readable form accessible by the
widest array of equipment including outdated equipment. Many small
donations ($1 to $5,000) are particularly important to maintaining
tax exempt status with the IRS.

The Foundation is committed to complying with the laws regulating


charities and charitable donations in all 50 states of the United
States. Compliance requirements are not uniform and it takes a
considerable effort, much paperwork and many fees to meet and
keep up with these requirements. We do not solicit donations in
locations where we have not received written confirmation of
compliance. To SEND DONATIONS or determine the status of
compliance for any particular state visit www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states where


we have not met the solicitation requirements, we know of no
prohibition against accepting unsolicited donations from donors in
such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot make


any statements concerning tax treatment of donations received from
outside the United States. U.S. laws alone swamp our small staff.

Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could be
freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose network of
volunteer support.
Project Gutenberg™ eBooks are often created from several printed
editions, all of which are confirmed as not protected by copyright in
the U.S. unless a copyright notice is included. Thus, we do not
necessarily keep eBooks in compliance with any particular paper
edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg Literary
Archive Foundation, how to help produce our new eBooks, and how
to subscribe to our email newsletter to hear about new eBooks.

You might also like