100% found this document useful (1 vote)
8 views

Developing Large Web Applications Producing Code That Can Grow and Thrive 1st Edition Kyle Loudonpdf download

The document provides links to download various ebooks and textbooks, including 'Developing Large Web Applications' by Kyle Loudon and others focused on web development and programming. It includes detailed information about the content and structure of the book, which covers topics such as modularity, object orientation, and performance in web applications. The document also emphasizes the importance of managing complexity in large web applications.

Uploaded by

gjurinmogati
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
8 views

Developing Large Web Applications Producing Code That Can Grow and Thrive 1st Edition Kyle Loudonpdf download

The document provides links to download various ebooks and textbooks, including 'Developing Large Web Applications' by Kyle Loudon and others focused on web development and programming. It includes detailed information about the content and structure of the book, which covers topics such as modularity, object orientation, and performance in web applications. The document also emphasizes the importance of managing complexity in large web applications.

Uploaded by

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

Download the full version and explore a variety of ebooks

or textbooks at https://ebookultra.com

Developing Large Web Applications Producing Code


That Can Grow and Thrive 1st Edition Kyle Loudon

_____ Tap the link below to start your download _____

https://ebookultra.com/download/developing-large-web-
applications-producing-code-that-can-grow-and-thrive-1st-
edition-kyle-loudon/

Find ebooks or textbooks at ebookultra.com today!


We have selected some products that you may be interested in
Click the link to download now or visit ebookultra.com
for more options!.

Flask Web Development Developing Web Applications With


Python 2nd Edition Miguel Grinberg

https://ebookultra.com/download/flask-web-development-developing-web-
applications-with-python-2nd-edition-miguel-grinberg/

Developing Responsive Web Applications with AJAX and


jQuery 1st Edition Sandeep Kumar Patel

https://ebookultra.com/download/developing-responsive-web-
applications-with-ajax-and-jquery-1st-edition-sandeep-kumar-patel/

Producing Flash CS3 Video Techniques for Video Pros and


Web Designers John Skidgel

https://ebookultra.com/download/producing-flash-cs3-video-techniques-
for-video-pros-and-web-designers-john-skidgel/

MCPD 70 519 Exam Ref Designing and Developing Web


Applications Using Microsoft NET Framework 4 1st Edition
Tony Northrup
https://ebookultra.com/download/mcpd-70-519-exam-ref-designing-and-
developing-web-applications-using-microsoft-net-framework-4-1st-
edition-tony-northrup/
Saltwater Aquarium Models Recipes for Creating Beautiful
Aquariums That Thrive 1st Edition John H. Tullock

https://ebookultra.com/download/saltwater-aquarium-models-recipes-for-
creating-beautiful-aquariums-that-thrive-1st-edition-john-h-tullock/

50 Diabetes Myths That Can Ruin Your Life And the 50


Diabetes Truths That Can Save It 1 Original Edition Riva
Greenberg
https://ebookultra.com/download/50-diabetes-myths-that-can-ruin-your-
life-and-the-50-diabetes-truths-that-can-save-it-1-original-edition-
riva-greenberg/

Server Driven Web Apps with htmx Any Language Less Code
Simpler Code 1st Edition R. Mark Volkmann

https://ebookultra.com/download/server-driven-web-apps-with-htmx-any-
language-less-code-simpler-code-1st-edition-r-mark-volkmann/

Developing Web Apps with Haskell and Yesod 2nd Edition


Michael Snoyman

https://ebookultra.com/download/developing-web-apps-with-haskell-and-
yesod-2nd-edition-michael-snoyman/

C Pocket Reference 1st Edition Loudon

https://ebookultra.com/download/c-pocket-reference-1st-edition-loudon/
Developing Large Web Applications Producing Code
That Can Grow and Thrive 1st Edition Kyle Loudon
Digital Instant Download
Author(s): Kyle Loudon
ISBN(s): 9780596803025, 0596803028
Edition: 1
File Details: PDF, 2.46 MB
Year: 2010
Language: english
Developing Large Web Applications
Developing Large Web Applications

Kyle Loudon
foreword by Nate Koechley

Beijing • Cambridge • Farnham • Köln • Sebastopol • Taipei • Tokyo


Developing Large Web Applications
by Kyle Loudon

Copyright © 2010 Yahoo!, Inc. All rights reserved.


Printed in the United States of America.

Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.

O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions
are also available for most titles (http://my.safaribooksonline.com). For more information, contact our
corporate/institutional sales department: (800) 998-9938 or corporate@oreilly.com.

Editor: Andy Oram Cover Designer: Karen Montgomery


Production Editor: Sumita Mukherji Interior Designer: David Futato
Copyeditor: Amy Thomson Illustrator: Robert Romano
Production Services: Newgen North America, Inc.

Printing History:
March 2010: First Edition.

Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of
O’Reilly Media, Inc. Developing Large Web Applications, the image of a Newfoundland, and related trade
dress are trademarks of O’Reilly Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a
trademark claim, the designations have been printed in caps or initial caps.

While every precaution has been taken in the preparation of this book, the publisher and author assume
no responsibility for errors or omissions, or for damages resulting from the use of the information con-
tained herein.

TM

This book uses RepKover™, a durable and flexible lay-flat binding.

ISBN: 978-0-596-80302-5

[M]

1267035305
Table of Contents

Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii

1. The Tenets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Managing Complexity 1
Modular Components 3
Achieving Modularity 3
Benefits of Modularity 4
Ten Tenets for Large Web Applications 4

2. Object Orientation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
The Fundamentals of OOP 8
Why Object Orientation? 9
UML Class Diagrams 9
Generalization 10
Association 10
Modeling a Web Page 11
Defining Page Types 11
Defining Module Types 11
Writing the Code 12
Achieving Modularity 14
Object-Oriented PHP 15
Classes and Interfaces 15
Inheritance in PHP 19
Object-Oriented JavaScript 22
Objects 22
Inheritance in JavaScript 25

3. Large-Scale HTML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Modular HTML 28

v
A Bad Example: Using a Table and Presentation Markup 28
A Better Example: Using CSS 30
The Best Example: Semantically Meaningful HTML 31
Benefits of Good HTML 35
HTML Tags 37
Bad HTML Tags 37
Good HTML Tags 38
IDs, Classes, and Names 40
Conventions for Naming 41
XHTML 41
Benefits of XHTML 41
XHTML Guidelines 42
RDFa 45
RDFa Triples 45
Applying RDFa 46
HTML 5 49

4. Large-Scale CSS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Modular CSS 52
Including CSS 52
Applying CSS 55
Specificity and Importance 57
Scoping with CSS 58
Standard Module Formats 63
Positioning Techniques 65
CSS Box Model 66
Document Flow 67
Relative Positioning 68
Absolute Positioning 68
Floating 70
Layouts and Containers 71
Example Layouts 72
Example Containers 80
Other Practices 82
Browser Reset CSS 83
Font Normalization 85

5. Large-Scale JavaScript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Modular JavaScript 88
Including JavaScript 88
Scoping with JavaScript 90
Working with the DOM 92
Common DOM Methods 92

vi | Table of Contents
Popular DOM Libraries 93
Working with Events 98
Event Handling Normalization 99
A Bad Example: Global Data in Event Handlers 99
A Good Example: Object Data in Event Handlers 100
Event-Driven Applications 101
Working with Animation 102
Motion Animation 102
Sizing Animation 103
Color Transition 104
An Example: Chained Selection Lists 105

6. Data Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115


Dynamic Modules 116
Data Managers 117
Creating Data Managers 120
Extending Data Managers 121
Data Using SQL As a Source 123
An SQL Example 124
Data Using XML As a Source 127
An XML Example 127
Data from Web Services 131
Data in the JSON Format 132
Cookies and Forms 133
Managing Data in Cookies 133
Managing Data from Forms 134

7. Large-Scale PHP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135


Modular Web Pages 136
Generating Pages in PHP 136
Working with Pages 141
Public Interface for the Page Class 141
Abstract Interface for the Page Class 144
Implementation of the Page Class 147
Extending the Page Class 157
Working with Modules 162
Public Interface for the Module Class 162
Abstract Interface for the Module Class 163
Implementation of the Module Class 164
Extending the Module Class 165
An Example Module: Slideshow 165
Layouts and Containers 177
Special Considerations 180

Table of Contents | vii


Handling Module Variations 180
Multiple Instances of a Module 181
Dynamic JavaScript and CSS 182
Implementing Nested Modules 182

8. Large-Scale Ajax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185


In the Browser 186
Managing Connections 186
Using Ajax Libraries 189
On the Server 194
Exchange Formats 194
Server Proxies 197
Modular Ajax 198
MVC and Ajax 200
Using Ajax with MVC 201
Public Interface for the Model Object 206
Implementation of the Model Object 207
Public Interface for the View Object 209
Abstract Interface for the View Object 209
View Object Implementation 210
Public Interface for the Connect Object 210
Abstract Interface for the Connect Object 211
Implementation of the Connect Object 212
Controllers 214
An Example of Ajax with MVC: Accordion Lists 215

9. Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Caching Opportunities 222
Caching CSS and JavaScript 222
Caching Modules 227
Caching for Pages 231
Caching with Ajax 231
Using Expires Headers 233
Managing JavaScript 234
JavaScript Placement 234
JavaScript Minification 234
Removing Duplicates 235
Distribution of Assets 237
Content Delivery Networks 237
Minimizing DNS Lookups 237
Minimizing HTTP Requests 238
Control Over Site Metrics 241
Modular Testing 243

viii | Table of Contents


Using Test Data 243
Creating Test Data 245

10. Application Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247


Thinking Modularly 247
Organizing Components 248
Sitewide Architecture 248
Section Architecture 254
Architecture for Pages 256
Architecture and Maintenance 258
Reorganizing Module Uses 258
Adding Module Variations 261
Making Widespread Changes 263
Changes in Data Sources 266
Exposing Modules Externally 268

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271

Table of Contents | ix
Foreword

As a little kid, I wondered if I would be big and strong when I grew up. There were a
lot of aspects to growing well. Would I be healthy? Useful? Productive? Successful?
Websites start out small, too. But these humble sites share my childhood dreams. They
want to help more people in more ways; they want to be durable and reliable; they want
to be indispensable and to live forever. In short: they want to be large and successful.
But growing up is hard to do. Challenges accumulate and complexity snowballs.
Expansion means complexity and complexity decay.
—C. Northcote Parkinson
I’ve seen it. The inevitable challenges of growth in websites—data management,
performance—become crippling if mishandled. Things you thought were straightfor-
ward, like HTML, start giving you headaches. From front to back, JavaScript to PHP,
harmony is displaced by dissonance.
Fools ignore complexity. Pragmatists suffer it. Some can avoid it. Geniuses remove it.
—Alan Perlis
I’ve worked hand-in-hand with Kyle on some of the Web’s largest applications. I’ve
watched him craft CSS systems to make sprawling sites skinable and design Ajax ar-
chitectures that adapt to and enhance the sites. He emerges from the trenches on top
every time. He’s a perpetual teacher, and, like the best in any discipline, also a perpetual
student. We all benefit from his expertise.
Kyle shares his genius and hard-won expertise in this valuable book that will prepare
you and your application for scale and success. The book is well structured and read-
able, with memorable tenets supported by savvy insights, sound philosophy, and fully
functioning code examples. Complexity is inevitable, but success rewards the prepared.
The way to build a complex system that works is to build it from very simple systems
that work.
—Kevin Kelly

xi
During this book’s deft tour of the complete web application stack, Kyle, the perfect
guide, converts lines of explanatory code from one context into insightful tips in
another. Build big by thinking small. Build new by thinking old. Manage scope. Boost
signal and reduce noise. Resist breakage...these things are easy to rattle off, but it takes
an author like Kyle, and a book like this, to make them practical and real.
If you’re ready to build a finely crafted large site, this is the book for you. Learn what
it takes, because today’s compromise is tomorrow’s constraint. Start today, because
the world is waiting for your application.
Grow large and prosper.
—Nate Koechley
San Francisco, January 2010

xii | Foreword
Preface

It’s been a while since I first worked on a book with O’Reilly in 1997. That book was
a practical guide to data structures and algorithms, a subject that, for the most part,
had been defined many years before by some of the early giants of computer science
(Dijkstra, Hoare, Knuth, to name a few). By comparison, I’ve been able to witness the
rapid evolution of the subject of this book from the front lines, and I have had the good
fortune to help refine it myself while working as a web developer at one of the largest
web applications in the world, Yahoo!.
Web developers have a fascinating role. We work just as closely with user experience
designers as with engineers, and sometimes we’re the designers, too. In many ways, we
are guardians of the user experience as a web design goes from its mockup to its im-
plementation. But we also have to write exceptionally good code that performs well in
the challenging environment of web browsers. Today, more than ever, engineers rec-
ognize that web development must be carried out with the same rigor as other types of
software development.
This book presents a number of techniques for applying established practices of good
software engineering to web development—that is, development primarily using the
disparate technologies of HTML, CSS, JavaScript, and server-side scripting languages.
Whereas there are many books on how to use languages, how to use libraries, and how
to approach software engineering, this is the first book to codify many of the techniques
it presents. These techniques will make the components of your own web applications
more reusable, maintainable, and reliable.

Audience
The primary audience for this book is software developers and managers interested in
large web applications; however, you’ll find that the techniques in this book are equally
useful for web applications of any size. Although it’s especially important to follow
good development practices in large web applications, smaller web applications benefit
from many of the same techniques, too.

xiii
Exploring the Variety of Random
Documents with Different Content
THE OLD PARLIAMENT HOUSE, EDINBURGH.
Strafford, on the previous Tuesday, hearing of the king's extreme
agitation and trouble on his account, had sent him a letter which
was full of magnanimity. He informed him that the hearing of the
king's unwillingness to pass the Bill, on the ground that he did not
believe him guilty, and of the excitement of the people against him
on that account, had brought him into a great strait; that the ruin of
his family on the one side, and fear of injury to the king on the
other, had greatly troubled him; that to say that there had not been
a great strife in him, would be to say that he was not made of flesh
and blood; yet considering that the chief thing was the prosperity of
the realm and the king, he had, with a natural sadness, come to the
conclusion to desire the king to let matters take their course rather
than incur the ill that refusing to sign the Bill might bring on his
sacred majesty. Whitelock assures us that the king sent Carleton to
him, to inform him that he had been compelled to pass the Bill, and
adding that he had been the more reconciled to it by his willingness
to die. On hearing this, Strafford started up from his chair, lifted up
his eyes to heaven, laid his hand upon his heart, and said, "Put not
your trust in princes, nor in the sons of men, for in them there is no
salvation."
The night before the day fixed for his execution, Archbishop Ussher
visited the prisoner, who begged him to go to his fellow-prisoner,
Archbishop Laud, and beg his prayers for him that night, and his
blessing when he should go forth in the morning. He had in vain
endeavoured to persuade the Lieutenant Balfour to permit him to
have an interview with the fallen prelate. In the morning, when led
out to the scaffold, on approaching the window of the archbishop's
prison, he begged the lieutenant to allow him to make his obeisance
towards the prelate's room, though he could not see him himself.

STRAFFORD ON HIS WAY TO EXECUTION.


After the Painting by Paul Delaroche, in the possession of the Duke of
Sutherland.
THE MARQUIS OF MONTROSE. (From a contemporary print by
Faithorne.)
Laud, however, was on the watch, and putting forth his hands from
his window, bestowed his blessing. That was all that his weakness
and his emotion permitted. He sank, overcome with his grief, to the
floor. Strafford made a profound obeisance, and the procession
moved on. But after a few steps the earl turned round again, bowed
to the ground once more, saying, "Farewell, my lord! God protect
your innocence!" Then proceeding again, he assumed a lofty and
dignified air, more even than was usual to him. At the Tower gate
the lieutenant requested him to enter a coach, lest the people
should wreak their hatred upon him; but he declined, saying, "No,
Master lieutenant, I dare look death in the face, and I hope the
people, too. Have you a care that I do not escape, and I care not
how I die, whether by the executioner, or the madness of the
people. If that give them better satisfaction, it is all one to me." He
was accompanied to the scaffold by Archbishop Ussher, the Earl of
Cleveland, and his brother, Sir George Wentworth, and others of his
friends were there to take their leave of him. The crowd assembled
to see their great enemy depart was immense, and he made a
speech from notes which he had prepared, still protesting his
innocence; declaring that so far from wishing to put an end to
Parliaments, he had always regarded them, under God, as the best
means to make the king and his people happy. His head fell at a
single blow, and the astonished people could scarcely believe that
they had seen the last of their foe. They retired in quietness, as if
overcome by the greatness of the satisfaction; but they testified
their joy in the evening by bonfires in the streets (May 12, 1641).
The fall of Strafford carried terror through the Court. Many began to
think of flying. Cottington had given up his office of Master of the
Wards, and Lord Say and other noblemen of the popular party were
introduced into the Ministry. The Marquis of Hertford was made
Governor to the Prince, the Earl of Essex Lord Chamberlain, the Earl
of Leicester the Lord-lieutenant of Ireland. The king was wholly
averse from the new ministers, but hoped to win upon them as he
had done upon Strafford, Loudon, and Montrose; and indeed, after
their appointment, a bolder and more independent spirit seemed to
awaken in the Lords. They threw out several Bills sent up from the
Commons, amongst others, one for excluding the bishops from their
House. Essex, though a reformer, was by no means hostile to the
hierarchy, and always obliged his servants to accompany him to
church, and kept a chaplain who was a thorough conformist. The
Lords did not object to the bishops and clergy in general being
excluded from the Star Chamber, the Privy Council, and the
Commissions of the Peace; but they contended that bishops had
always formed a part of their body, and that the Commons might
next take it into their heads to exclude barons.
The Commons, however, pressed on the Lords Bills for the abolition
of the two greatest engines of tyranny in the country, the Star
Chamber and the High Commission Court. These, with another for a
poll-tax for the maintenance of the armies, the Lords passed; but
Charles hesitated. He had given up much this Session: the right of
prorogation without consent of Parliament, thus making Parliament
perpetual if it pleased; the right to demand tonnage and poundage
without the same consent; he had limited the forest laws; granted to
the judges their places during good behaviour; and withdrawn the
commission for the Presidency of the North as illegal. But to give up
the civil and ecclesiastical inquisitions, those ready and terrible
torture houses of the Crown, went hard with him. The poll-tax he
passed at once, because he thought it would be unpopular, but he
refused to sanction the others. The Commons came to a resolution
that he should pass all three or none; and the tone of both
Parliament and the people was so menacing, that on the 5th of July
he gave his consent, and put an end to those un-English
abominations.
The Commons having granted the king six subsidies, and tonnage
and poundage for the year, he now proposed to proceed to Scotland
to hold a Parliament. He was aware that a reaction had taken place
there. The Marquis of Montrose had exerted himself to form a party
amongst such noblemen and gentlemen as had grown to regard the
popular leaders both in Scotland and England as bearing too
insolently on the prerogatives of the Crown. He had prevailed on
nineteen noblemen to subscribe a bond, pledging themselves "to
oppose the particular and indirect practices of a few, and to study all
public ends which might tend to the safety of religion, laws, and
liberty." They were careful that the language of this bond should not
clash openly with that of the Covenant; but the real design did not
escape the vigilance of the Committee of Estates. They called on
Montrose and his associates to clear themselves, and obtaining the
bond, burn it publicly. Notwithstanding this, the confederates opened
a secret correspondence with the king, and assured him of their
confidence of victory over the Covenanters, if he would honour the
Parliament with his presence, confirm his former concessions, and
delay the distribution of offices and honours to the end of the
session. But this correspondence also was discovered. Walter Stuart,
the messenger of Montrose to the king, was seized near Haddington,
and the letter of the marquis to the king, with various other
suspicious papers, was found concealed in the pommel of his saddle.
Montrose, Lord Napier, Sir George Stirling, and Sir Archibald Stuart,
were arrested, examined, and sent to the castle of Edinburgh.
These events rendered Charles still more impatient for his northern
journey. Not only Traquair, and the other four of his officers who had
been excepted from pardon as incendiaries, but these, his new
allies, demanded his assistance. By the beginning of August the
treaty of pacification was signed by the Scots. They had received an
engagement from the English Parliament for the payment of a
balance of two hundred and twenty thousand pounds of "the
brotherly assistance." Charles had granted an amnesty and an act of
oblivion of all that was past, having cost the kingdom about one
million one hundred thousand pounds, and both armies were
ordered to be disbanded. The Parliament, however, looked on this
journey with no friendly eye. Even amongst his own friends, the wily
old Bishop of Lincoln, Williams, whom the king, in the absence of
Laud, and the loss of Strafford, had taken into favour, and who was
soon to be Archbishop of York, advised Charles to keep away from
the Scots. He assured him that they would ferret out any secret
negotiations that might pass between himself and the royal party,
and make the English Commons acquainted with them; and that he
would do much better to remain, and employ himself in corrupting
and winning over as many as he could of the Parliamentary leaders.
The Commons insisted on his appointing a Regency, if he should go,
to act during his absence; but he consented only to the naming of a
Commission. It was not till the 10th of August that he got permission
for his journey, and he was not destined to depart without having
another proof of the animus of the House of Commons. On the 4th,
Serjeant Wild presented to the Lords a Bill of Impeachment against
thirteen of the bishops—Laud's name being put among them—for
their recent manufacturing of canons and constitutions contrary to
law. Their grant of a benevolence to the king was made an offence
under the name of a bribe, and by this means, though they had not
been able to exclude all the bishops from the Upper House for ever,
they excluded these thirteen for a time.
At length Charles was enabled to set out. He had made the Earl of
Holland commander-in-chief of the Forces, much to the disgust of
the friends of Essex, who was appointed commander only of those
south of the Trent. He was attended in his coach by his nephew,
Charles Louis, the nominal Elector Palatine, the Duke of Lennox, now
Duke of Richmond, and the Marquis of Hamilton—rather ominous
associates. The king had not been gone a week, however, when
Holland having quarrelled with the queen, and the king having
refused to make a baron at his suggestion, by which he would have
got ten thousand pounds, sent a letter to the House of Lords,
obscurely intimating some new practices and designs against
Parliament. The Lords communicated to the Commons this letter,
and the two Houses immediately appointed a commission to proceed
to Scotland, ostensibly to procure the ratification of the late treaty,
but really to keep watch over the king and his partisans. To this duty
were named the Earl of Bedford, Lord Edward Howard, Sir William
Almayne, Sir Philip Stapleton, Mr. Hampden, and Nathaniel Fiennes.
The king endeavoured to get rid of this unwelcome commission,
declaring it needless, and refused to sign the commission when sent
to him; but the Parliament still pressing it, he allowed the
commissioners to proceed to Scotland to attend him; all of whom did
so except the Earl of Bedford.
Charles had set out with the resolve to win over as many of his
enemies as possible, and to please the Scots at large, thereby to
raise up a counter influence to that at home. At the northern camp,
which was not yet broken up, he did all that he could to corrupt the
officers, went to dine with old Leslie, the Scottish general, and soon
after ennobled him. At Edinburgh he flattered the Covenanters by
attending their preachings, and went so far as to appoint Alexander
Henderson, the stout champion of the Covenant, his chaplain,
appearing to take especial delight in his conversation, and having
him constantly about him. He ratified all the acts of the last Session
of the Scottish Parliament. As regarded the incendiaries, as they
were called—that is, Charles's former ministers—who had been
imprisoned for executing his commands, he promised on their
release to give their offices to such persons as had pleased the
Parliament. He submitted to them a list of forty-two councillors, and
nine great officers of State. The Parliament conceded so far as to
release all the incendiaries but five, and these were to be referred to
a committee for trial, and their sentence to be pronounced by the
king. So far, all promised well, but the Covenanters were desirous to
have the Earl of Argyll, who had so openly espoused their cause in
the General Assembly, appointed to the chief post in the ministry,
that of Chancellor; but Charles conferred it on Loudon. Argyll strove
for the next, that of Treasurer, a post of great emolument, but
Charles gave it to Lord Ormond; but the Parliament would not
consent, and the contest for this appointment had gone on ten days,
when the feud thus commenced was rent still wider by what is
known in Scottish history as the "Incident."
Since Charles had come to Edinburgh, he had continued to keep up
his correspondence with the Marquis of Montrose, who was still
prisoner in the castle, and who, notwithstanding his known intrigue
with the king, had by concert with him kept up a pretence of being a
zealous Covenanter. A letter from Montrose, revealing the progress
of this correspondence, had been found by some traitorous person
about the king, supposed, indeed, to have been taken from his
pocket, and had been sent by the Marquis of Hamilton to the
Covenanters. Montrose found means to convey to the king his ideas
about it, and to warn him especially of the treasonable proceedings
and intentions of Hamilton and Argyll. Hamilton, since his having, at
Charles's request, assumed the part of a favourer of the
Covenanters, had become suspected of being more really of that
party than he pretended. The king had grown cool in his manner to
him: the letters of Montrose, conveyed through William Murray, a
groom of the bed-chamber, urged the king to make away with the
traitors Hamilton and Argyll. At this juncture young Lord Kerr sent by
the Earl of Crawford a challenge of treason to Hamilton, who
appealed to Parliament in his justification, and Kerr was compelled to
make an apology. But if we are to believe Hamilton himself, this did
not prevent the prosecution of the plot to assassinate or carry them
off to some place of concealment. He says, in a letter to his brother,
Lord Lanark, that he was sent for suddenly by his brother and Argyll,
as he was engaged with some company, desiring him to go to them
on matters of the utmost consequence. When he went he was told
by them that they had been desired to go to General Leslie, at his
house, who informed them of a plot to kill or carry them away. On
this being confirmed to Hamilton by Colonel Hurrie and Captain
Stuart, the three lost no time in escaping from the city to Hamilton
House, at Kinneil; whilst the rumour of the plot spreading, the
burghers of Edinburgh had closed their gates, and armed themselves
for the defence of the Parliament.
As this was a direct charge of a most black and murderous design on
the part of the king, he lost no time, on receiving letters from the
fugitive noblemen stating why they had fled, in marching to the
Parliament House at the head of five hundred soldiers, to demand an
explanation. The Parliament was justly alarmed at this menacing
movement, and insisted that a commission should immediately be
given to Leslie to guard Parliament with all the city bands, the
regiments of foot near at hand, and some troops of horse.
Charles was loud in his complaints of the scandal cast upon him by
the needless flight of the three noblemen and the arming of the
citizens, and demanded an instant examination before Parliament for
his clearance. The Parliament would not consent to a trial before the
whole House; but in spite of the king's remonstrances, referred it to
a committee, and ordered the immediate arrest of the Earl of
Crawford, Colonel Cochrane, William Murray, and others. What the
committee discovered is not known, for its proceedings were
conducted with the profoundest secrecy; and they finally came to
the conclusion that there was nothing which touched the king
personally; and yet that the noblemen did not flee without sufficient
cause, and were falsely accused by Montrose. Montrose himself,
when examined regarding the letter to the king, declared that he
meant to accuse nobody in particular; and Crawford, Murray, and the
rest, gave confused and disordered answers. All was involved in
mystery, and this was no little increased by Hamilton and Argyll
returning to Edinburgh in the course of a few weeks, and Hamilton
declaring that there was nothing in the affair which reflected any
dishonour on the king. Still more to confound all reasoning on the
matter, the plotters not only were liberated on bail, but Argyll was
placed at the head of the Treasury, was created a marquis, Hamilton
a duke, and Leslie an earl, with the title of Leven.
The news of the plot had been despatched with all speed to the
Parliament in England, and had created great alarm in London, many
being of opinion that a conspiracy was on foot to get rid of all the
king's opponents. Parliament, which had adjourned to the 20th of
October, had just met again, and the Council sent urgent requests
for the return of the king to the capital.
The king, however, appeared in no haste. He remained entertaining
all parties in great festivity, distributing the forfeited church lands
amongst influential persons, not excepting his covenanting chaplain,
Henderson. Honours were as freely bestowed. It was found that
Charles had carried the Crown jewels with him: it was now well
known that the great collar of rubies was pawned in Holland, and it
was believed that Charles was buying up his enemies with others of
the jewels, afterwards to be exchanged for money. These unpleasant
suspicions were greatly increased by the fact that five companies of
foot had, by the king's especial command, been detained at Berwick,
notwithstanding the order for disbandment. The Council sent six
ships to fetch away the artillery and ammunition from Berwick and
Holy Isle, and again represented to Charles the necessity of his
presence in London.
His departure, however, was at length determined by startling news
out of another quarter, namely, of rebellion in Ireland.
INDEX
Abbott Bishop, Primate, 464.
"Addled Parliament," The, 453.

Albany, Duke of, assumes title of Alexander, King of Scotland,


44.
Albany, Duke of, proclaimed joint king with Mary of Scotland,
assassination of Rizzio, 264;
flees to Dunbar with Mary, 266;
unpopularity among the nobles, 267;
plot against him, 268;
murdered, 269.
(See also Darnley, Lord.)
Amboise, Peace of, 258.

Amiens, Truce of, 39.


Archery, Decay of, 16th century, 388.
Architecture, 15th century, 67;
16th century, decline of Gothic, 380;
old Tudor, 381.
Argyle, Earl of, chief director of the Assembly, 572.
Armada, The Spanish, preparation by Philip, 315;
English fleet, 316;
strength of Armada, preparation for defence, 318;
sets sail, driven back by storm, sails up Channel, chased by
English, 319;
fight renewed, 320;
fire ships, 322;
retreat of Armada, English land forces, 323.

Arms and Armour, 16th century, 387.


Arran, Earl of, Regent, 191;
relations with England, 193;
with France, 194;
reconciled to Beaton, 194.

Arthur, Prince, married to Catherine of Aragon, 97;


death and character, 98.
Ascham, Roger, 363.
Aske, Robert, executed, 172.
Askew, Anne, tortured and burnt, 202.
Audley, Lord, the Cornish rising, 90.

Babington, Anthony, plot against Elizabeth, 306;


execution, 307.
Bacon, Sir Francis, scheme for managing Commons, 452;
Attorney General, 453;
undignified conduct on fall of Coke, Lord Keeper, 459;
Buckingham and Coke's daughter, 468;
Lord Chancellor, Baron Verulam, 470.
(See also Verulam, Baron.)
Bacon, Sir Nicholas, first Baronet created, 452.
Bancroft, Bishop of London, Archbishop of Canterbury, 415;
animosity to Catholic and Protestant Nonconformists, 419;
supports James's claim to Royal Prerogative, 439;
death, 441.
Bankruptcy, Statute of, 347.
Barnet, Battle of, 34.

Baronet, new title created by James I.: its abuse, 452.


"Basilicon Doron," 413.
Bastwick, Dr., 555, 591.
Beaton, Cardinal, sent to Rome, 190;
claims regency, solicits aid from France, imprisonment, 191;
escape, 192;
plot to assassinate, 196;
burns Wishart, 199;
assassinated, 200.
"Benevolences," 453.
"Black Saturday," 206.
Blackwater, Battle of, 334.
"Bloody Statute," The, 175.

Boleyn, Anne, 146;


created Marchioness of Pembroke, married privately to Henry
VIII., crowned, 156;
plot against, 164;
indicted for high treason, 166;
her defence, 167;
beheaded, 168.
Bonner, Bishop of London, imprisoned by Ecclesiastical
Commission, 207;
deprived of his see, 216;
restoration of Catholicism, inhumanity, 236;
chief inquisitor, 238;
treated coldly by Elizabeth, 246.
Bosworth, Battle of, 63.
Bothwell, Earl of, murder of Darnley, mock trial and acquittal,
270;
divorce from his wife, created Duke of Orkney and Shetland,
marriage with Mary, 271;
rising of nobility, flight and death, 272.
Bothwell, Lord, intrigues to capture Scottish king, 89;
spy in Scottish camp, 90.
Brackenbury, Sir Robert, 54.
Brandon, Sir Charles, Lord Lisle. (See Suffolk, Duke of.)
Buckingham, Duke of, 47;
harangues citizens of London in favour of Gloucester, offers
crown to him, 54;
instigates revolt to set Edward V. on the throne: his descent,
54;
proclaimed traitor by Richard III., 56;
marches to join Richmond, 57;
executed at Salisbury, 58.
Buckingham, Duke of, executed on charge of practising
astrology, 124.
Buckingham, George Villiers, Duke of, 470;
his power, 471;
in Spain, 491;
at conference of Houses, 500;
impeachment, 519;
French expedition, 524;
assassinated, 536.
"Buckingham's Flood," 58.

Bulmer, Lady, burnt at Smithfield, 172.


Burleigh, Lord, Norfolk's execution, 289;
urges death of Mary, 290;
Mendoza, 303;
Lord Treasurer, 308;
Mary's death-warrant, 311;
counsels assistance to Henry of Navarre, 327;
death, 332.
"Bye Plot," The, 408.

Carr, Robert, 44.


(See Rochester, Viscount.)
Casket Letters, The, 278.
Cateau-Cambresis, Treaty of, 250.

Catesby, Robert, Gunpowder Plot, 419.


Catherine of Aragon, married to Prince Arthur, 97;
betrothed to Prince Henry, 98;
married, 102;
regent during Henry's absence in France, 107;
treatment by the King, 146;
trial, 151;
divorce, 156.
Cavendish, Thomas, successful expedition to Spanish Main, 315.

Caxton, William, 66.


Cecil, Sir Robert, assembles council to proclaim James King,
404;
enmity to Raleigh, Cobham, and Gray, 406;
created Lord Cecil, Viscount Cranbourne, Earl of Salisbury,
406;
conspiracy against, 408;
Catesby's conspiracy, 423;
Lord Treasurer, 438;
death, 441.
Cecil, Sir William, confidential counsellor of Elizabeth, Secretary
of State, 246;
policy to Scottish reformers, 252;
Cecil and Elizabeth's relations to Leicester, 259;
Cecil and Murray, 277;
hostility to Mary Stuart's friends, 278;
Cecil and Knox, 283;
Scottish policy, 285;
Duke of Norfolk and Ridolfi plot, 288.
(See also Burleigh, Lord.)

Charles, Prince, Spanish match, 491;


Henrietta of France, 503.

Charles I., First Parliament, 509;


tonnage and poundage, 514;
scheme to prevent Buckingham's impeachment, Second
Parliament, 315;
illegal government, 522;
failure of expedition to Rhé, 524;
Third Parliament, 527;
the subsidies, 528;
Petition of Right, resistance of Charles, 531;
passed, 534;
force sent under Buckingham to aid the Rochellais, 535;
crowned at Edinburgh, 550;
adherence to Anglican Church, 551;
Bishop Williams, 556;
ship money, treaty with Spain against Holland, 557;
treatment of Irish, 564;
renewal of the covenant, temporises, 570;
letter to general assembly, 572;
conference, 578;
Wentworth, 581;
the Short Parliament, 584;
illegal extortions, 585;
Scottish Parliament, 586;
the Long Parliament, 590;
trial of Strafford, 595;
visits Scotland, 606.
Charolais, Count of, 38.

Chimneys, Introduction of, 382.


Clarence, Duke of, marries Isabel of Warwick, retires to Calais,
26;
at Olney, 27;
secret agreement with Edward to desert Warwick, 30;
joined in regency with Warwick, Lord Lieutenant of Ireland,
31;
deserts to Edward on eve of Barnet, 33;
quarrel with Gloucester, 36;
act of resumption, death of Isabel, 40;
suitor of Mary of Burgundy, 41;
at feud with Edward, charged with treason, death in the
Tower, 42.
Cleves, Anne of, 178;
her reception by, and marriage to Henry VIII., 179;
divorced, retires to her estates, 183.
Coins and coinage, 15th century, 75;
16th century, their debasement, 392;
restitution of value by Elizabeth, 393.
Coke, Lord, indicts Raleigh, 410;
trial of Somerset, 453;
supports royal prerogative, 458;
disgrace, 459;
restored, 469;
popular leader, 489;
speeches in Parliament, 528.

Colonies, 395.
Commerce, 16th century, 394.
"Complaints of the Commons of Kent," 2.
Congregationalists, 356.
Costumes, 16th century, 388.
Courtenay, Earl of Devon, plot to marry Elizabeth and dethrone
Mary, 238.

Coverdale, Miles, 237.


Cranmer, Thomas, plan for settlement of King's divorce, 155;
Archbishop of Canterbury, 156;
Chancellor of the Exchequer, 157;
introduces bill for the supremacy and the succession, 158;
confesses Anne Boleyn, 167;
head of reforming party, 170;
conforms outwardly to statute of Six Articles, 175;
Anne of Cleves, 179;
fall of Cromwell, 182;
Catherine Howard, 184;
catechism, 207;
frames articles and canons, 219;
attainted, 227;
trial at St. Mary's, Oxford, 238;
cited to appear at Rome, renouncement and recantation, 239;
burnt at Oxford, 240.
Cromwell, Oliver, 538.

Cromwell, Thomas, successful advice on divorce to Henry VIII.,


Privy Councillor, 155;
Archbishop of Canterbury, pronounces Henry's marriage with
Anne Boleyn valid, 156;
Vicar General, 163;
Lord Cromwell, 170;
proposes royal marriage with Anne of Cleves, 178;
Earl of Essex and Lord Chamberlain, 180;
bill of attainder, execution, character, 182.

Culpepper, Thomas, alleged intrigue with his cousin, Catherine


Howard, 184;
attainted and executed, 185.

Darnley, Lord, 261;


marries Mary Queen of Scots, created Duke of Albany, 263.
(See Albany, Duke of.)
Daubeny, Lord, suppresses Cornish rising, 91;
commands Royal forces against Warbeck, 94.

"De Tallagio non concedendo," 530, 559.


Desmond, Earl of, rebellion, 296.
Digby, Sir Everard, Gunpowder Plot, 424.
Dighton, John, murders Princes in the Tower, 54.
Douglas, Archibald, Earl of Angus, "Bell the Cat," puts to death
Earl of Mar, 44.
Drake, Sir Francis, sent by Elizabeth to harass Spanish
settlements, special favours from the Queen, 305;
exploits against the Spaniards, circumnavigates the globe,
knighted, 314;
destruction of ships in Cadiz harbour, 315;
fights against the Armada, 319;
expedition to Portugal, 326;
failure of expedition against Spanish settlements, death, 328.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookultra.com

You might also like