100% found this document useful (11 votes)
81 views

jQuery in Action 2nd Edition Bear Bibeault 2024 scribd download

Bibeault

Uploaded by

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

jQuery in Action 2nd Edition Bear Bibeault 2024 scribd download

Bibeault

Uploaded by

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

Download the full version of the ebook at ebookname.

com

jQuery in Action 2nd Edition Bear Bibeault

https://ebookname.com/product/jquery-in-action-2nd-edition-
bear-bibeault/

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...

jQuery in action 1st Edition Bear Bibeault

https://ebookname.com/product/jquery-in-action-1st-edition-bear-
bibeault/

ebookname.com

jQuery UI in Action 1st Edition Tj Vantoll

https://ebookname.com/product/jquery-ui-in-action-1st-edition-tj-
vantoll/

ebookname.com

Teddy Bear Teddy Bear 1st Edition Alice Schertle

https://ebookname.com/product/teddy-bear-teddy-bear-1st-edition-alice-
schertle/

ebookname.com

Analysis and Performance of Engineering Materials Key


Research and Development 1st Edition Gennady E. Zaikov
(Editor)
https://ebookname.com/product/analysis-and-performance-of-engineering-
materials-key-research-and-development-1st-edition-gennady-e-zaikov-
editor/
ebookname.com
Boundary Elements And Other Mesh Reduction Methods XXVIII
v 28 C. A. Brebbia

https://ebookname.com/product/boundary-elements-and-other-mesh-
reduction-methods-xxviii-v-28-c-a-brebbia/

ebookname.com

American Railroad Labor and the Genesis of the New Deal


1919 1935 1st Edition Jon R. Huibregtse

https://ebookname.com/product/american-railroad-labor-and-the-genesis-
of-the-new-deal-1919-1935-1st-edition-jon-r-huibregtse/

ebookname.com

Innate and Adaptive Immunity in the Tumor Microenvironment


Eitan Yefenof

https://ebookname.com/product/innate-and-adaptive-immunity-in-the-
tumor-microenvironment-eitan-yefenof/

ebookname.com

Seeing Things Whole The Essential John Wesley Powell First


Edition John Wesley Powell

https://ebookname.com/product/seeing-things-whole-the-essential-john-
wesley-powell-first-edition-john-wesley-powell/

ebookname.com

Social and Personal Identity 1st Edition Derek Layder

https://ebookname.com/product/social-and-personal-identity-1st-
edition-derek-layder/

ebookname.com
The Bible in the Syriac Tradition Third Edition Sebastian
Brock

https://ebookname.com/product/the-bible-in-the-syriac-tradition-third-
edition-sebastian-brock/

ebookname.com
Bear Bibeault Covers jQuery 1.4 and jQuery UI 1.8
Yehuda Katz

IN ACTION
SECOND EDITION

MANNING
Praise for the First Edition

This is an excellent work, a worthy successor to others in Manning’s “In Action” series. It is
highly readable and chock-full of working code. The Lab pages are a marvelous way to explore
the library, which should become an important part of every web developer’s arsenal. Five stars
all ‘round!
—David Sills, JavaLobby, Dzone

I highly recommend the book for learning the fundamentals of jQuery and then serving as a good
reference book as you leverage the power of jQuery more and more in your daily development.
—David Hayden, MVP C#, Codebetter.com

The Elements of Style for JavaScript.


—Joshua Heyer, Trane Inc.

For those new to jQuery, this book is a good primer that covers a range of common uses of the
framework.... The examples throughout the book are relevant, and make the point effectively.
The code snippets are easily distinguishable from the rest of the text, and the text is clear and
easy to follow.
—Grant Palin, Blogger

It works and makes for a very readable book that you can just breeze through very quickly and
pick up and retain a lot of information.
—Rich Strahl, Blogger

Thanks to the authors Bear Bibeault and Yehuda Katz and their exemplary style, this compre-
hensive book, or operating manual as it might be called, can be taken in a front-to-back approach
to learn from scratch, or as a reference to those already dabbling in jQuery and needing verifica-
tion of best practices.
—Matthew McCullough,
Denver Open Source Users Group

With its capable technical coverage, extensive use of sample code, and approachable style,
jQuery in Action is a valuable resource for any Web developer seeking to maximize the power
of JavaScript, and a must-have for anyone interested in learning jQuery.
—Michael J. Ross,
Web Developer, Slashdot Contributor
More Praise for the First Edition

An 8 out of 10—buy it! If you want to learn jQuery then this is an excellent book...
—John Whish, Founder,
Adobe ColdFusion User Group for Devon

I highly recommend this book to any novice or advanced JavaScript developers who finally want
to get serious about JavaScript and start writing optimized and elegant code without all the
hassle of traditional JavaScript code authoring.
—Val’s Blog

jQuery in Action offers a rich investigation of the up-and-coming jQuery library for client-side
JavaScript.
—www.DZone.com

I think that jQuery in Action is an excellent book that will help you learn and understand
jQuery. I certainly enjoyed reading the book.
—Gunnar Hillert,
Atlanta Java User Group
jQuery in Action
Second Edition

BEAR BIBEAULT
YEHUDA KATZ

MANNING
Greenwich
(74° w. long.)
For online information and ordering of this and other Manning books, please visit
www.manning.com. The publisher offers discounts on this book when ordered in quantity.
For more information, please contact
Special Sales Department
Manning Publications Co.
180 Broad St.
Suite 1323
Stamford, CT 06901
Email: orders@manning.com

©2010 by Manning Publications Co. All rights reserved.

No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in


any form or by means electronic, mechanical, photocopying, or otherwise, without prior written
permission of the publisher.

Many of the designations used by manufacturers and sellers to distinguish their products are
claimed as trademarks. Where those designations appear in the book, and Manning
Publications was aware of a trademark claim, the designations have been printed in initial caps
or all caps.

Recognizing the importance of preserving what has been written, it is Manning’s policy to have
the books we publish printed on acid-free paper, and we exert our best efforts to that end.
Recognizing also our responsibility to conserve the resources of our planet, Manning books
are printed on paper that is at least 15 percent recycled and processed without the use of
elemental chlorine.

Manning Publications Co. Development editor: Lianna Wlasiuk


180 Broad St. Copyeditor: Andy Carroll
Suite 1323 Typesetter: Dottie Marsico
Stamford, CT 06901 Cover designer: Marija Tudor

ISBN 978-1-935182-32-0
Printed in the United States of America
1 2 3 4 5 6 7 8 9 10 – MAL – 15 14 13 12 11 10
brief contents
PART 1 CORE JQUERY .............................................................. 1
1 ■ Introducing jQuery 3
2 ■ Selecting the elements upon which to act 18
3 ■ Bringing pages to life with jQuery 55
4 ■ Events are where it happens! 93
5 ■ Energizing pages with animations and effects 138
6 ■ Beyond the DOM with jQuery utility functions 169
7 ■ Expand your reach by extending jQuery 204
8 ■ Talk to the server with Ajax 235

PART 2 JQUERY UI .............................................................. 279


9 ■ Introducing jQuery UI: themes and effects 281
10 ■ jQuery UI mouse interactions: Follow that mouse! 305
11 ■ jQuery UI widgets: Beyond HTML controls 346
appendix ■ JavaScript that you need to know but might not! 415

v
contents
list of lab pages xiii
foreword to the first edition xv
preface to the second edition xvii
preface to the first edition xix
acknowledgments xxii
about this book xxv
about the authors xxx
about the cover illustration xxxii

PART 1 CORE JQUERY .................................................. 1

1 Introducing jQuery
1.1
3
Power in the economy of code 4
1.2 Unobtrusive JavaScript 6
Separating behavior from structure 6 ■ Segregating the script 7
1.3 jQuery fundamentals 8
The jQuery wrapper 8 Utility functions 11 The document
■ ■

ready handler 11 Making DOM elements 13 Extending


■ ■

jQuery 14 Using jQuery with other libraries 16


1.4 Summary 16

vii
viii CONTENTS

2 Selecting the elements upon which to act


2.1 Selecting elements for manipulation
Controlling the context 20 Using basic CSS selectors 22

18
19

Using child, container, and attribute selectors 23 Selecting by ■

position 27 Using CSS and custom jQuery filter selectors 29


2.2 Generating new HTML 32


2.3 Managing the wrapped element set 35
Determining the size of a wrapped set 37 Obtaining elements from a

wrapped set 37 Slicing and dicing a wrapped element


set 41 Getting wrapped sets using relationships 49 Even more


■ ■

ways to use a wrapped set 51 Managing jQuery chains 52


2.4 Summary 54

3 Bringing pages to life with jQuery


3.1 Working with element properties and attributes
55

Manipulating element properties 58 Fetching attribute



56

values 58 Setting attribute values 60 Removing


■ ■

attributes 62 Fun with attributes 62 Storing custom data on


■ ■

elements 64
3.2 Changing element styling 65
Adding and removing class names 66 ■ Getting and
setting styles 70
3.3 Setting element content 77
Replacing HTML or text content 77 Moving and copying

elements 78 Wrapping and unwrapping elements 84


Removing elements 86 Cloning elements 87 Replacing


■ ■

elements 88
3.4 Dealing with form element values 89
3.5 Summary 92

4 Events are where it happens!


4.1
93
Understanding the browser event models
The DOM Level 0 Event Model 95 The DOM Level 2 Event

95

Model 101 The Internet Explorer Event Model 106


4.2 The jQuery Event Model 106


Binding event handlers with jQuery 107 Removing event ■

handlers 111 Inspecting the Event instance 112 Proactively


■ ■

managing event handlers 115 Triggering event handlers 117


Other event-related methods 119


CONTENTS ix

4.3 Putting events (and more) to work 124


Filtering large data sets 124 Element creation by template

replication 126 Setting up the mainline markup 129


Adding new filters 130 Adding the qualifying controls 133


Removing unwanted filters and other tasks 134 There’s always ■

room for improvement 135


4.4 Summary 136

5 Energizing pages with animations and effects


5.1 Showing and hiding elements
Implementing a collapsible “module”
139
140 ■
138

Toggling the display state


of elements 143
5.2 Animating the display state of elements 144
Showing and hiding elements gradually 144 Fading elements into ■

and out of existence 149 Sliding elements up and down 152


Stopping animations 153


5.3 Creating custom animations 154
A custom scale animation 156 ■ A custom drop animation 156
A custom puff animation 157
5.4 Animations and Queuing 159
Simultaneous animations 159 Queuing functions for■

execution 162 Inserting functions into the effects queue


■ 166
5.5 Summary 167

6 Beyond the DOM with jQuery utility functions


6.1 Using the jQuery flags 170
Disabling animations 170 Detecting user agent support

169

171
The browser detection flags 175
6.2 Using other libraries with jQuery 177
6.3 Manipulating JavaScript objects and collections 180
Trimming strings 180 Iterating through properties and

collections 181 Filtering arrays 183 Translating arrays 184


■ ■

More fun with JavaScript arrays 186 Extending objects 187 ■

Serializing parameter values 189 Testing objects 193 ■

6.4 Miscellaneous utility functions 194


Doing nothing 194 Testing for containment 194 Tacking
■ ■

data onto elements 195 Prebinding function contexts 195


Parsing JSON 198 Evaluating expressions 199


Dynamically loading scripts 199


6.5 Summary 202
x CONTENTS

7 Expand your reach by extending jQuery


7.1 Why extend jQuery? 205
204

7.2 The jQuery plugin authoring guidelines 205


Naming files and functions 206 ■ Beware the $ 207 ■ Taming
complex parameter lists 208
7.3 Writing custom utility functions 210
Creating a data manipulation utility function 211 ■ Writing a date
formatter 212
7.4 Adding new wrapper methods 216
Applying multiple operations in a wrapper method 218
Retaining state within a wrapper method 223
7.5 Summary 233

8 Talk to the server with Ajax


8.1 Brushing up on Ajax 236
235

Creating an XHR instance 237 Initiating the request 239


Keeping track of progress 240 Getting the response 240


8.2 Loading content into elements 241


Loading content with jQuery 243 ■ Loading dynamic HTML
fragments 245
8.3 Making GET and POST requests 250
Getting data with GET 252 ■ Getting JSON data 254
Making POST requests 254 ■ Implementing cascading
dropdowns 255
8.4 Taking full control of an Ajax request 261
Making Ajax requests with all the trimmings 261 ■ Setting request
defaults 264 Handling Ajax events 265

8.5 Putting it all together 268


Implementing the Termifier 270 Putting the Termifier to the

test 274 Improving the Termifier 277


8.6 Summary 278

PART 2 JQUERY UI................................................... 279

9 Introducing jQuery UI: themes and effects


9.1 Configuring and downloading the UI library
Configuring and downloading 283 ■
281
282
Using the UI library 284
CONTENTS xi

9.2 jQuery themes and styling 285


Overview 286 ■ Using the ThemeRoller tool 288
9.3 jQuery UI Effects 291
The jQuery UI effects 291 Extended core animation

capabilities 296 Augmented visibility methods 296


Animating class transitions 297 Easings 299 ■

9.4 Advanced positioning 300


9.5 Summary 303

10 jQuery UI mouse interactions: Follow that mouse!


10.1 Dragging things around 307
Making elements draggable 308 ■ Draggability events
305

312
Controlling draggability 313
10.2 Dropping dragged things 314
Making elements droppable 315 ■ Droppability events 318
10.3 Sorting stuff 322
Making things sortable 323 Connecting sortables 327

Sortability events 327 Fetching the sort order 329


10.4 Changing the size of things 330


Making things resizable 331 ■ Resizability events 334
Styling the handles 335
10.5 Making things selectable 336
Creating selectables 340 Selectable events
■ 342 ■ Finding the
selected and selectable elements 344
10.6 Summary 345

11 jQuery UI widgets: Beyond HTML controls


11.1 Buttons and buttonsets
Button appearance within UI themes
347
346

348 Creating themed


buttons 349 Button icons 352


■ ■ Button events 352
Styling buttons 353
11.2 Sliders 354
Creating slider widgets 354 ■ Slider events 358 ■ Styling tips for
sliders 359
11.3 Progress bars 360
Creating progress bars 361 Progress bar events 362

An auto-updating progress bar plugin 363 Styling ■

progress bars 369


xii CONTENTS

11.4 Autocompleters 369


Creating autocomplete widgets 370 Autocomplete sources
■ 372
Autocomplete events 375 Autocompleting in style 376

11.5 Date pickers 377


Creating jQuery datepickers 377 Datepicker date formats 385

Datepicker events 387 Datepicker utility functions 387


11.6 Tabs 389


Creating tabbed content 389 ■ Tab events 396 ■ Styling
tabs 397
11.7 Accordions 397
Creating accordion widgets 398 Accordion events 402

Styling classes for accordions 403 Loading accordion panels using


Ajax 404
11.8 Dialog boxes 405
Creating dialog boxes 405 Dialog events 410
■ ■ Dialog box class
names 411 Some dialog box tricks 412

11.9 Summary 413


11.10 The end? 414
appendix JavaScript that you need to know but might not! 415
index 433
list of lab pages
Selectors . . . . . . . . . . . . . . . . . . . 20
Operations . . . . . . . . . . . . . . . . . 35
Move and Copy . . . . . . . . . . . . . 81
Effects. . . . . . . . . . . . . . . . . . . . . 148
$.param(). . . . . . . . . . . . . . . . . . 192
Rounded Corners . . . . . . . . . . . 288
UI Effects . . . . . . . . . . . . . . . . . . 291
UI Easings . . . . . . . . . . . . . . . . . 299
Positioning . . . . . . . . . . . . . . . . . 301
Draggables . . . . . . . . . . . . . . . . . 308
Droppables. . . . . . . . . . . . . . . . . 315
Sortables. . . . . . . . . . . . . . . . . . . 324
Resizables . . . . . . . . . . . . . . . . . . 331
Selectables . . . . . . . . . . . . . . . . . 338
Buttons . . . . . . . . . . . . . . . . . . . . 350
Sliders. . . . . . . . . . . . . . . . . . . . . 356
Autocompleters . . . . . . . . . . . . . 372
Datepickers . . . . . . . . . . . . . . . . 379
Tabs . . . . . . . . . . . . . . . . . . . . . . 392
Accordions . . . . . . . . . . . . . . . . . 401
Dialogs . . . . . . . . . . . . . . . . . . . . 408

xiii
foreword to the first edition
It’s all about simplicity. Why should web developers be forced to write long, complex,
book-length pieces of code when they want to create simple pieces of interaction?
There’s nothing that says that complexity has to be a requirement for developing web
applications.
When I first set out to create jQuery I decided that I wanted an emphasis on small,
simple code that served all the practical applications that web developers deal with
day to day. I was greatly pleased as I read through jQuery in Action to see in it an excel-
lent manifestation of the principles of the jQuery library.
With an overwhelming emphasis on practical, real-world code presented in a terse,
to-the-point format, jQuery in Action will serve as an ideal resource for those looking
to familiarize themselves with the library.
What’s pleased me the most about this book is the significant attention to detail
that Bear and Yehuda have paid to the inner workings of the library. They were thor-
ough in their investigation and dissemination of the jQuery API. It felt like nary a day
went by in which I wasn’t graced with an email or instant message from them asking
for clarification, reporting newly discovered bugs, or recommending improvements to
the library. You can be safe knowing that the resource that you have before you is one
of the best thought-out and researched pieces of literature on the jQuery library.
One thing that surprised me about the contents of this book is the explicit inclu-
sion of jQuery plugins and the tactics and theory behind jQuery plugin development.
The reason why jQuery is able to stay so simple is through the use of its plugin

xv
xvi FOREWORD TO THE FIRST EDITION

architecture. It provides a number of documented extension points upon which plu-


gins can add functionality. Often that functionality, while useful, is not generic
enough for inclusion in jQuery itself—which is what makes the plugin architecture
necessary. A few of the plugins discussed in this book, like the Forms, Dimension, and
LiveQuery plugins, have seen widespread adoption and the reason is obvious: They’re
expertly constructed, documented, and maintained. Be sure to pay special attention
to how plugins are utilized and constructed as their use is fundamental to the jQuery
experience.
With resources like this book, the jQuery project is sure to continue to grow and
succeed. I hope the book will end up serving you well as you begin your exploration
and use of jQuery.

JOHN RESIG
CREATOR OF jQUERY
preface to the second edition
It’s been two years since the first edition of jQuery in Action was published. Was it really
necessary to update the book so soon?
Absolutely!
Compared to the steady world of server-side languages such as Java, the client-side
technologies of the web move at a mighty fast clip. And jQuery isn’t eating anyone’s
dust; rather, it’s at the forefront of the rush!
The jQuery team releases a major new version of the library just about every year
(lately, striving for every January), in addition to the minor updates that are made
throughout the calendar year. That means that there have been numerous minor
releases, and two major versions since the publication of the first edition, which was
written against jQuery 1.2. And what updates jQuery 1.3 and jQuery 1.4 have been!
With each major release, the capabilities of jQuery have been extended and
enhanced in significant ways. Whether it be the addition of custom events, event
namespaces, function and effect queuing, or simply the large handful of really useful
methods and functions that have been added, the range of capabilities that jQuery
spans has increased significantly since the first edition hit the stands.
And that doesn’t even consider jQuery UI! In its nascent stages two years ago,
jQuery UI merited a few sections in one chapter of the first edition. Since then, jQuery
UI has grown in scope and maturity and warrants a complete book part in this edition,
consisting of three full chapters.
So it should come as no surprise that this second edition has made its way onto
the shelves covering the advances that jQuery and jQuery UI have made over the past
two years.

xvii
xviii PREFACE TO THE SECOND EDITION

What’s new in the second edition?


When we decided to go ahead with creating a second edition of jQuery in Action, I
remember someone saying to me, “Should be a piece of cake. After all, you just need
to make some updates to the first edition.”
How wrong they were! It actually took longer to complete this second edition than
to write the book in the first place. You see, we didn’t want to fall into the trap of
“phoning it in” by just adding updates here and there and calling it done. We wanted
this second edition to be much more than a warmed over version of the first edition.
Anyone comparing the table of contents of the first and second editions of this
book will note that the structure of chapters 1 through 8 hasn’t changed all that
much. But that’s pretty much where the similarities stop.
This second edition isn’t just a tepid rehash of the first edition with some extra
information sprinkled here and there. Each and every paragraph in the text, and each
and every line in the example code, has undergone a careful inspection. Not only
have the additions and changes made to jQuery between versions 1.2 and 1.4 been
taken into account, the information in the chapters and the example code have been
updated to reflect current best practices regarding page scripting and the use of
jQuery. After all, as a community, we’ve got two more years of experience writing
highly interactive scripted pages using jQuery under our belts.
Every example has been examined and either updated to better show how to use
jQuery 1.4 in practice, or replaced with an example that is better suited to showcasing
the concepts being discussed. For example, readers of the first edition may remember
the comprehensive Bamboo Grille example at the end of chapter 4 that highlighted
jQuery event handling. Try as we might, we were unable to reshape that example to
flaunt the newest jQuery event handling concepts, such as “live” and custom events.
So it has been completely replaced with the DVD Ambassador example that serves as a
better vehicle for demonstrating the advanced event-handling concepts.
The second part of the book, focusing on jQuery UI, is completely new material,
covering the extensive changes that jQuery UI has undergone since the first edition
was published.
We’d estimate that, counting the additions, replacements, and updates of the
material presented throughout the first part of the book, as well as the completely new
content of part 2, that at least 50 percent of this second edition is brand new material.
The other 50 percent has undergone extensive rework to ensure that it is up to date
and reflective of modern best practices.
So much for the “piece of cake”!
preface to the first edition
One of your authors is a grizzled veteran whose involvement in programming dates
back to when FORTRAN was the bomb, and the other is an enthusiastic domain
expert, savvy beyond his years, who’s barely ever known a world without an Internet.
How did two people with such disparate backgrounds come together to work on a
joint project?
The answer is, obviously, jQuery.
The paths by which we came together over our affection for this most useful of cli-
ent-side tools are as different as night and day.
I (Bear) first heard of jQuery while I was working on Ajax in Practice. Near the end
of the creation cycle of a book is a whirlwind phase known as the copyedit when the
chapters are reviewed for grammatical correctness and clarity (among other things)
by the copyeditor and for technical correctness by the technical editor. At least for me,
this is the most frenetic and stressful time in the writing of a book, and the last thing I
want to hear is “you really should add a completely new section.”
One of the chapters I contributed to Ajax in Practice surveys a number of Ajax-
enabling client-side libraries, one of which I was already quite familiar with (Proto-
type) and others (the Dojo Toolkit and DWR) on which I had to come up to speed
pretty quickly.
While juggling what seemed like a zillion tasks (all the while holding down a day
job, running a side business, and dealing with household issues), the technical editor,
Valentin Crettaz, casually drops this bomb: “So why don’t you have a section on
jQuery?”

xix
xx PREFACE TO THE FIRST EDITION

“J who?” I asked.
I was promptly treated to a detailed dissertation on how wonderful this fairly new
library was and how it really should be part of any modern examination of Ajax-
enabling client-side libraries. I asked around a bit. “Have any of you ever heard of this
jQwerty library?”
I received a large number of positive responses, all enthusiastic and all agreeing
that jQuery really was the cat’s pajamas. On a rainy Sunday afternoon, I spent about
four hours at the jQuery site reading documentation and writing little test programs to
get a feel for the jQuery way of doing things. Then I banged out the new section and
sent it to the technical editor to see if I had really gotten it.
The section was given an enthusiastic thumb’s up, and we went on to finally com-
plete the Ajax in Practice book. (That section on jQuery eventually went on to be pub-
lished in the online version of Dr. Dobb’s Journal.)
When the dust had settled, my frenzied exposure to jQuery had planted relentless
little seeds in the back of my mind. I’d liked what I’d seen during my headlong
research into jQuery, and I set out to learn more. I started using jQuery in web proj-
ects. I still liked what I saw. I started replacing older code in previous projects to see
how jQuery would simplify the pages. And I really liked what I saw.
Enthusiastic about this new discovery and wanting to share it with others, I took
complete leave of my senses and submitted a proposal for jQuery in Action to Manning.
Obviously, I must’ve been convincing. (As penance for causing such mayhem, I asked
the technical editor who started all the trouble to also be the technical editor for this
book. I’ll bet that taught him!)
It’s at that point that the editor, Mike Stephens, asked, “How would you like to
work with Yehuda Katz on this project?”
“Yehenta who?” I asked…

Yehuda came to this project by a different route; his involvement with jQuery predates
the days when it even had version numbers. After he stumbled on the Selectables
Plugin, his interest in the jQuery core library was piqued. Somewhat disappointed by
the (then) lack of online documentation, he scoured the wikis and established the
Visual jQuery site (visualjquery.com).
Before too long, he was spearheading the push for better online documents, con-
tributing to jQuery, and overseeing the plugin architecture and ecosystem, all while
evangelizing jQuery to the Ruby community.
Then came the day when he received a call from Manning (his name having been
dropped to the publisher by a friend), asking if he’d be interested in working with this
Bear guy on a jQuery book…

Despite the differences in our backgrounds, experiences, and strengths, and the man-
ner in which we came together on this project, we’ve formed a great team and have
PREFACE TO THE FIRST EDITION xxi

had a lot of fun working together. Even geographic distance (I’m in the heart of
Texas, and Yehuda is on the California coast) proved no barrier. Thank goodness for
email and instant messaging!
We think that the combination of our knowledge and talents brings you a strong
and informative book. We hope you have as much fun reading this book as we had
working on it.
We just advise you to keep saner hours.
acknowledgments
Have you ever been surprised, or even bewildered, by the seemingly endless list of
names that scrolls up the screen during the ending credits of a motion picture? Do
you ever wonder if it really takes that many people to make a movie?
Similarly, the number of people involved in the writing of a book would probably
be a big surprise to most people. It takes a large collaborative effort on the part of
many contributors with a variety of talents to bring the volume you are holding (or
ebook that you are reading onscreen) to fruition.
The staff at Manning worked tirelessly with us to make sure that this book
attained the level of quality that we hoped for, and we thank them for their efforts.
Without them, this book would not have been possible. The “end credits” for this
book include not only our publisher, Marjan Bace, and editor Mike Stephens, but
also the following contributors: Lianna Wlasiuk, Karen Tegtmayer, Andy Carroll,
Deepak Vohra, Barbara Mirecki, Megan Yockey, Dottie Marsico, Mary Piergies,
Gabriel Dobrescu, and Steven Hong.
Enough cannot be said to thank our peer reviewers who helped mold the final
form of the book, from catching simple typos to correcting errors in terminology and
code and even helping to organize the chapters within the book. Each pass through a
review cycle ended up vastly improving the final product. For taking the time to help
review the book, we’d like to thank Tony Niemann, Scott Sauyet, Rich Freedman,
Philip Hallstrom, Michael Smolyak, Marion Sturtevant, Jonas Bandi, Jay Blanchard,
Nikander Bruggeman, Margriet Bruggeman, Greg Donald, Frank Wang, Curtis Miller,
Christopher Haupt, Cheryl Jerozal, Charles E. Logston, Andrew Siemer, Eric

xxii
ACKNOWLEDGMENTS xxiii

Raymond, Christian Marquardt, Robby O’Connor, Marc Gravell, Andrew Grothe, Anil
Radhakrishna, Daniel Bretoi, and Massimo Perga.
Very special thanks go to Valentin Crettaz, who served as the book’s technical edi-
tor. In addition to checking each and every sample of example code in multiple envi-
ronments, he also offered invaluable contributions to the technical accuracy of the
text, located information that was originally missing, kept abreast of rapid changes to
the libraries while we were writing to make sure that the book represented an up-to-
date and accurate view of jQuery and jQuery UI, and even provided the PHP versions
of the examples requiring server-side code.

Bear Bibeault
For this, my fourth published tome, the cast of characters I’d like to thank has a long
list of “usual suspects,” including, once again, the membership and staff at
javaranch.com. Without my involvement in JavaRanch, I’d never have gotten the
opportunity to start writing in the first place, and so I sincerely thank Paul Wheaton
and Kathy Sierra for starting the whole thing, as well as fellow staffers who gave me
encouragement and support, including (but probably not limited to) Eric Pascarello,
Ben Souther, Ernest Friedman Hill, Mark Herschberg, Andrew Munkhouse, Jeanne
Boyarski, Bert Bates, and Max Habbibi.
Thanks go out to Valentin Crettaz, not only for serving as a superb technical editor
and code contributor (as noted above), but also for introducing me to jQuery in the
first place.
My partner Jay, and my dogs, Little Bear and Cozmo (whose visages grace the
pages of this book), get the usual warm thanks for putting up with the shadowy pres-
ence who shared their home but who rarely looked up from his MacBook Pro key-
board for all the months it took to write this book.
And finally, I’d like to thank my coauthor, Yehuda Katz, without whom this project
would not have been possible, as well as John Resig and the rest of the jQuery and
jQuery UI contributors.

Yehuda Katz
To start, I’d like to thank Bear Bibeault, my coauthor, for the benefit of his exten-
sive writing experience. His talented writing and impressive abilities to navigate the
hurdles of professional publishing were a tremendous part of what made this book
possible.
While speaking of making things possible, it’s necessary that I thank my lovely wife
Leah, who put up with the long nights and working weekends for far longer than I
would have felt comfortable asking. Her dedication to completing this book rivaled
even my own; and, as in all things, she made the most difficult part of this project
bearable. I love you, Leah.
Obviously, there would be no jQuery in Action without the jQuery library itself. I’d
like to thank John Resig, the creator of jQuery, for changing the face of client-side
xxiv ACKNOWLEDGMENTS

development and easing the burden of web developers across the globe (believe it or
not, we have sizable user groups in China, Japan, France, and many other countries). I
also count him as a friend who, as a talented author himself, helped me to prepare for
this tremendous undertaking.
There would be no jQuery without the incredible community of users and core
team members, including Brandon Aaron and Jörn Zaefferer on the development
team; Rey Bango and Karl Swedberg on the evangelism team; Paul Bakaus, who heads
up jQuery UI; and Klaus Hartl and Mike Alsup, who work on the plugins team with
me. This great group of programmers helped propel the jQuery framework from a
tight, simple base of core operations to a world-class JavaScript library, complete with
user-contributed (and modular) support for virtually any need you could have. I’m
probably missing a great number of jQuery contributors; there are a lot of you guys.
Suffice it to say that I would not be here without the unique community that has come
up around this library, and I can’t thank you enough.
Lastly, I want to thank my family, whom I don’t see nearly enough since my recent
move across the country. Growing up, my siblings and I shared a tight sense of camara-
derie, and the faith my family members have in me has always made me imagine I can
do just about anything. Mommy, Nikki, Abie, and Yaakov: thank you, and I love you.
Another Random Scribd Document
with Unrelated Content
APPENDIX XIV
chronological sketch of afghan history

1747.—Nadir Shah, a Turcoman bandit, conquers Persia with an


army composed largely of Afghans. Sacks Delhi and is assassinated
in camp on return from India.
Sirdar Ahmed Khan, an Afghan cavalry general of the Saddozai
section of the Abdali Afghans, seizes the treasure near Kandahar
and has himself crowned king of the Durani with the title of Ahmed
Shah, Duri Duran. With Ahmed commences history of Afghan nation
as an independent kingdom. He builds Kandahar shortly afterwards,
calling it Ahmed Shahior Ahmed Shahr. (These events occur about
1747.) Ahmed Shah reigns twenty-six years. He replenishes his
treasuries by frequent invasions of India. He is succeeded by his son
Timour Shah.
1773.—Timour Shah’s succession to the throne. He removes the
seat of government from Kandahar to Kabul. He reigns twenty years
and dies 1793, leaving three sons:
(1) Zaman Shah, who reigns four years, living chiefly at
Peshawar. He is deposed by his half-brother, Mahommed, and
blinded as retaliation for having caused to be executed Wazir
Surfaraz Khan Barakzai (called Paindah Khan).
(2) Mahommed, who is attacked and imprisoned by
(3) Shah Shujah, full brother of Zaman Shah. He ascends the
throne of Kabul, but lives principally at Peshawar.
1800.—Proposed invasion of India by the emperors Paul and
Napoleon.
1807.—Scheme of Indian invasion by the emperors Alexander
and Napoleon.
1809.—News having been received that Emperor Napoleon and
Tsar Alexander had agreed to invade India through Persia, Mr.
Elphinstone is sent as an ambassador to Kabul, meets Shah Shujah
at Peshawar, and concludes a treaty.
1809.—Fateh Khan, son of murdered Wazir Surfaraz Khan,
releases Mahommed and places him on the throne. Flight of Shah
Shujah from Peshawar to take refuge with Ranjit Singh at Lahore,
the latter extracting from him the famous Koh-i-Nur diamond, but
refusing to protect him.
1818.—Murder of Fateh Khan by order of Shah Mahommed and
his son Kamran. Country again convulsed with anarchy. Mahommed
and Kamran retire to Herat, the rest of the country being divided
between the brothers of Fateh Khan, the murdered Wazir, amongst
whom Dost Mahommed Khan got Kabul, Jelalabad, and Ghazni.
1826.—Accession of Dost Mahommed, Amir of Afghanistan.
1832.—Lieutenant A. Burnes’ journey to Kabul, Bokhara, Merv,
and Meshed.
1833.—Unsuccessful Persian expedition against Herat.
1837.—Persia, instigated by Russia, marches against Herat.
1837.—Siege of Herat and defence by Eldred Pottinger,
November 1837, to June 1838.
1837.—Mission of Sir Alexander Burnes to Kabul to make peace
between Dost Mahommed and Ranjit Singh, September 1837.
1837.—Russian agent, Vitkievitch, at Kabul, December 1837.
1838.—Wood explores the Upper Oxus to Lake Siri-kol.
1838.—Rupture of relations with Dost Mahommed. Recall of
Burnes.
1838.—Beginning of first Afghan War, November 1838.
1839.—Capture of Kandahar.
1839.—Capture of Kabul, flight of Dost Mahommed, and
restoration of Shah Shujah (August).
1840.—Rising of Dost Mahommed (September).
1840.—Defeat and surrender of Dost Mahommed at Bamian
(November).
1841.—Assassination of Sir A. Burnes at Kabul (November).
1841.—Murder of Sir W. Macnaghten at Kabul (December).
1842.—Siege of British forces in Kabul (December 1841, to
January 1842).
1842.—Retreat and massacre of British army (January).
1842.—Advance of British relief column under General Pollock
(April).
1842.—March of General Nott from Kandahar to Kabul (August to
September).
1842.—General Pollock re-enters Kabul (September).
1842.—Evacuation of Afghanistan (October).
1842.—Dost Mahommed restored to throne.
1854.—Meeting between Ghulan Hydel, Envoy of Dost
Mahommed and Sir John Laurence at fort Abbotabad to discuss
question of alliance.
1855.—First treaty between Great Britain and Dost Mahommed
(January).
1856.—Surrender of Herat to the Persians (October).
1857.—Meeting between Sir John Laurence and Dost
Mahommed at Peshawar.
1857.—Second treaty between Great Britain and Dost
Mahommed (January).
1857.—Grant of subsidy to Dost Mahommed of 12 lakhs.
1857.—Mission of Major Lumsden to Kandahar (March to April).
1857.—War between Great Britain and Persia upon behalf of
Afghanistan (November 1856, to March 1857).
1857.—Appointment of British agent to Kabul. Removal to
Kandahar.
1857.—Treaty of Paris between Great Britain and Persia (March).
1858.—Recall of Kandahar Mission: agent remains.
1858.—Russian Mission of Khanikoff to Herat.
1858.—Death of Ghulam Hyder, son of Dost Mahommed; and
Shir Ali nominated successor to Dost Mahommed.
1863.—Death of Dost Mahommed (June). Accession of Shir Ali;
return to Kabul with British Agent from Kandahar.
1863.—Requests recognition of Mahommed Ali; treaty of peace,
and grant of 6000 rupees.
1863-1868.—Civil War in Afghanistan.
Consequent upon the nomination of Shir Ali, serious dissension
occurred in the family of Dost Mahommed. Upon the succession of
Shir Ali, rebellion broke out, and Azim, brother to Shir Ali by a
different mother, fled into British territory. Afzal, the brother of Azim,
serving as Governor of Balkh, also revolted. Shir Ali defeated Afzal,
imprisoning him in August 1864. Abdur Rahman, the son of Afzal,
was pursued by Shir Ali. Abdur Rahman was joined by Azim, the two
marching on Kabul, released Afzal and attacked Kabul in 1866. Shir
Ali fled to Kandahar, Afzal entering Kabul as Amir on May 21, 1866.
Recognised by the Government of India, he died suddenly in 1867.
He was succeeded by Azim, who was never recognised officially by
the Government of India. Shir Ali then marched against Azim in
1869, defeating him. Azim died in flight to Teheran, the final triumph
and the concluding act of the rebellion being the accession to the
throne of Shir Ali Khan in 1869.
1865.—Mahommed Ali killed.
1869.—Flight of Abdur Rahman Khan to Samarkand.
1869.—Shir Ali endeavours to obtain recognition by British
Government of his son Abdullah Jan as successor. Refused.
1869.—Umballa Conference between Lord Mayo and Shir Ali
(March).
1869.—First overtures from Lord Clarendon to Prince Gortchakow
about Afghanistan.
1872.—Gortchakow-Granville Agreement as to boundaries of
Afghanistan (October).
1872.—Seistan Boundary Commission.
1873.—Evidences of estrangement of Shir Ali from Government
of India.
1873.—Abdullah Jan proclaimed heir-apparent. Yakub Khan
revolts. Flight to Herat.
1874.—Imprisonment at Kabul of Yakub Khan.
1876.—Cool reception of Mission from Lord Lytton to Kabul.
1876.—Quetta occupied.
1877.—Abortive Conference at Peshawar between Sir L. Pelly
and the Prime Minister of Shir Ali, Nur Mahomet Shah (February).
1877.—Estrangement of Shir Ali completed.
1878.—Kauffman threatens invasion of Afghanistan and India
(June).
1878.—Pamir column despatched under General Abramoff
(June).
1878.—Arrival of Stolietoff mission at Kabul (July).
1878.—Refusal of Shir Ali to allow the Mission under Sir Neville
B. Chamberlain, Commander of the Madras army, to enter
Afghanistan. Major Cavagnari and party threatened with attack at Ali
Musjid if progress through Khyber Pass maintained (September 20
and 21).
1878.—Advance continued, November 21.
1878.—Colonel Grodekoff’s ride from Samarkand to Herat
(October to November).
1878.—Denunciation of alliance with Dost Mahommed by Lord
Lytton (November 21).
1878.—Second Afghan War begun (November).
1878.—Flight of Shir Ali from Kabul and release of Yakub Khan.
1879.—Death of Shir Ali in February and accession of Yakub
Khan (February).
1879.—Treaty of Gandamak with Yakub Khan (June 8).
1879.—Assassination of Sir L. Cavagnari at Kabul, Dr. Ambrose
Kelly, Lieut. Hamilton, and Mr. Jenkins and others (September 3 and
4).
1879.—Third Afghan War begun (September 6). March of
General Roberts on Kabul.
1879.—General Roberts arrives at Kabul (September 28), and
occupies Dakka (September 22).
1879.—Execution of murderers of Sir L. Cavagnari (October 20-
24).
1879.—Twenty-five thousand Afghans defeated by Generals
Roberts and Gough (December 23).
1879.—Kabul deserted by Afghans; re-occupation by British
(December 26).
1879.—Yakub Khan deported to India (December).
1880.—Recognition of Abdur Rahman Khan as Amir (July).
1880.—Disaster of Maiwand (July 27). Defeat of General Burrows
by Ayub Khan.
1880.—March of Sir F. Roberts to the relief of Kandahar (leaving
Kabul August 8, arriving Kandahar August 31).
1880.—Rejection of Ayub’s terms by Sir F. Roberts and defeat of
Ayub at Mazra (or Battle of Kandahar on September 1).
1881.—Evacuation of Kandahar and entry of Abdur Rahman
(September 30).
1882-1883.—Surveys of Lessar.
1882.—Moslim agent appointed to represent British Government
at Kabul.
1882.—Quetta district handed over on a rent to the British.
1882.—Prince Lobanoff converses with Lord Granville re Prince
Gortchakow’s circular of 1873.
1883.—Occupation by Russia of Tejend oasis (October).
1883.—Quetta district ceded to Great Britain.
1883.—Shignan and Roshan occupied by Abdur Rahman Khan.
1883.—Abdur Rahman passes a law concerning the status of
women.
1883.—Subsidy of 12 lakhs, granted by Lord Ripon to Abdur
Rahman, due.
1884.—Frontier negotiations between Great Britain and Russia.
Sir Peter Lumsden proceeds with British Mission to Herat to
demarcate Northern Boundary of Afghanistan.
1884.—Recommencement of Quetta Railway.
1884.—Sir P. Lumsden sent as British Boundary Commissioner
(October 1884).
1884.—The Russians occupy Pul-i-Khatun (October).
1885.—The Russians occupy Zulfikar and Akrobat, and advance
upon Pendjeh (February).
1885.—Fight between the Russians and Afghans at Tash-Kepri
on the Kushk (March 30).
1885.—Rawal Pindi conference between Lord Dufferin and Abdur
Rahman Khan. Amir received K.C.S.I. (April).
1885.—War scare in Great Britain (April).
1885.—Sir P. Lumsden recalled. Colonel West Ridgeway remains
on the scene of activities of Mission.
1885.—British and Russian Boundary Commissioners meet
again. First boundary pillar formally erected (November 12).
1886.—Bolan Railway constructed to Quetta.
1886.—Demarcation of Afghan boundary up to separation of
Commission (September).
1886.—Return of British Commission through Kabul to India
(October).
1887.—Occupation of Karki by Russia (May).
1887.—Negotiations at St. Petersburg continued and concluded
(July).
1887.—Final settlement and demarcation of Afghan frontier
(winter).
1887.—Escape of Ayub Khan from Persia; failure of rebellion in
Afghanistan.
1887.—Surrender of Ayub Khan to General Maclean, Viceroy’s
Agent at Meshed, and detention in India.
1888.—Quetta Railway continued to Kila Abdulla (January).
1888.—Revolt of Is-hak Khan against Abdur Rahman Khan (July
to September).
1888.—Retreat of Is-hak Khan to Samarkand.
1889.—War scare on the Oxus boundary (February to March).
1891.—Abdur Rahman introduces the Oath of Allegiance on the
Koran among his councillors.
1891.—Abdur Rahman appoints Habib Ullah to hold public
Durbars.
1893.—Sir Mortimer Durand goes to Kabul to explain drift of
negotiations between Great Britain and Russia in connection with
Northern frontier and Pamir region.
1893.—Durand Agreement.
1893.—Increase of subsidy granted to Abdur Rahman by six
lakhs, and permitted to import munitions of war as required.
1893.—Abdur Rahman recognises British protectorate over
Chitral and agrees to respect Bajaor and Swat.
1893.—New Chaman occupied as railway terminus.
1894.—Abdur Rahman invited to England by Queen Victoria;
unable to accept.
1895.—Abdur Rahman abolished slavery in Afghanistan.
1895.—Oath of Allegiance accepted from whole of the State of
Afghanistan by Abdur Rahman.
1895.—Abdur Rahman adopts title Zia-ul-Millat-ud-Din.
1895.—Visit of Nasr Ullah Khan, second son of Abdur Rahman, to
England.
1901.—Death of Abdur Rahman (October 1). Habib Ullah
proclaimed (October 3).
1902-1903.—Re-erection of boundary pillars on Perso-Afghan
border.
1903.—Construction Quetta-Nushki Railway begun.
1903-1904-1905.—McMahon Mission for delimitation of Seistan
boundary.
1904.—Opening of the Orenburg-Tashkent Railway.
1904.—Visit of Sirdar Inayat Ullah to India.
1904-1905.—Mission of Sir Louis Dane to Kabul.
1905.—Opening of the Quetta-Nushki Railway (November).
1905.—Resignation of Lord Curzon of Kedleston. Appointment of
Earl Minto as Viceroy of India. Kitchener-Curzon controversy.
1905-06.—Extension of railway to Dakka.
1906.—Shah rejects the award made by McMahon Mission in
respect of the waters of the Helmund.
1906.—Rumours of autumn. Visit of Habib Ullah to India.

MAP OF

AFGHANISTAN
BY
Angus Hamilton
Fellow of the Royal Geographical Society
London: H. Heinemann. Stanford’s Geogˡ Estabᵗ London
INDEX
Abdur Rahman, 91, 152, 247, 253, 258, 355-356, 433
Accession of Habib Ullah and, 432
Administrative system of, 269, 272
Afridi Elders and, 421-422, 424
Army under, 318-321, 325
Chitral crisis and, 415
Decline and death of, 432-434, 439
Lord Dufferin and, 401
Sir M. Durand and, 406
Lord Elgin and, 416, 418, 420
Europeans employed by, 394
Fiscal policy of, 231, 290-291
Foreign relations, 356-357, 403, 446
Frontier disturbances, 419, 422, 424
Gifts to, 402
Gun-running, 397
Sir Lepel Griffin and, 400
Imports of munitions, 407
Indian Government and, 419-425
Invited to England, 409
Mobilisation scheme, 432
Mullahs and, 415-416, 442
Queen Victoria, 433
Reception of Turkish visitor by, 416
Recognition of, as Amir, 400
Refusal to visit India, 403
Refusal to receive Roberts Mission, 405
Lord Ripon and, 400
Shir Afzal, 413, 414
and South African War, 432
Subsidy, 407
Swat-Tochi rising, 417
Theological studies of, 415
Treaties, 406, 412, 455
Tribal affairs, 270-271, 443, 447
Visits Afghan-Turkestan, 402
Warns Viceroy, 409
Western therapeutics and, 389
Abramoff, General, 40
Adiz Abad, 69
Afghan Turkestan, 94, 242, 262
Area of, 247
Coal deposits in, 396
Subjugation of, 250
Visited by Abdur Rahman, 402
Afghan War, First, 148
Second, 151, 152, 448
Afghanistan, administrative system of, 269-287
British relations with, 147-149, 155-156, 187-189, 220, 250, 356,
373, 375, 446, 455, 457, 458
Climate of, 261, 262
Currency of, 283
Ethnographic distribution, 262-263, 267-268
Khanates of, 250-253
Laws of, 275-280
Minerals of, 304
Orology of, 259, 260
Products and manufactures, 298-307
Provinces of, 242-247
Revenue of, 282-287
Rivers in, 260-276 (See Rivers)
Russian relations with, 121-122, 356, 440, 443, 447, 457-458
Trade of, 236, 288-298, 306
Afridis, 264, 408, 417, 418, 419, 423, 446
Agerskski valley, 14
Agreements (See Treaties)
Ahmed Khan, Sirdar, 189
Ahmed, Shah, tomb of, 190, 193
Akcha, 247, 258
Akrobat, 401
Aktash, 174
Ak-Tepe, 117
Aktinbinsk, 6, 7, 9, 13, 14
Alai mountains, 25, 26, 30
Alayar Khan, 62
Alcock, Surgeon-Captain A. W., 156
Alexander II., 60
Alexander of Macedon, 58, 62, 109
Alexandrovski, 18
Alexeieffski, 120, 124
Alichm Pamir, 174
Ali Mardan Khan, 377
Ali Masjid, 419 (See also Khyber)
Ali Yai Khan, remarks of, 445
Alvar, 259
Amir Ullah Khan, 362, 436
Ampthill, Lord, 452
Amritsar, 202
Amu Daria (See Oxus)
Amu Daria flotilla, 74, 75, 96, 97, 98, 102-104
Anardara, 204
Anderab, 244, 253
Anderson, Mr., 409
Andijan, 6, 11, 43, 49, 59, 110
Andkhui, 173, 242, 247, 258-259
Anglo-Afghan Boundary Mission, 155
Anglo-Russian Boundary Mission, 138, 141
Annenkoff, General, 7, 76
Annenkovo, 76, 77
Aral sea, 10, 16, 95, 96
Ardewan pass, 126, 157
Aris, 11
Army, 308-326
Under Abdur Rahman, 318-321, 325
Under Dost Mahommed, 308-311
Under Habib Ullah, 321-324
Under Shir Ali, 311-318
Askhabad, 3, 4, 5, 11, 70, 103, 173
Aslam Khan, Colonel, 419
Asmar valley, 403, 408, 425
Auckland, Lord, 1, 148
Aulie-ata, 8
Ayub Khan, 152, 187

Baber, 346
Badakshan, 242, 243, 244, 250-253, 405
Badghis, 156
Bad-i-sad-o-bist roz, 223
Badjira, 129
Baghdad, 237, 238
Baglan, 253
Bairam Ali, 77, 78, 79
Bajaur-Mohmands, 408, 412, 413, 414, 417
Bakhtiaris, 204
Bakwa plain, 181
Bala Murghab, 119, 135, 142
Balfour, Mr. A. J., speeches of, 457
Balkan hills, 96
Balkash, 8
Balkh, 173, 177, 242, 247, 250, 256-257, 260, 310-311
Balkh-Herat route, list of marches, 329-330
Baluchis, 204, 226, 227, 228, 241
Baluchistan, 189
Bam, 237
Bamian, 182, 243, 247
Band-i-Turkestan, 258
Bangash, Upper, 243
Bannu, 429
Barak pass, 228
Barakail, 250
Barkhani, 76
Barnaul, 8
Baroghil pass, 244
Barton, Captain, 419
Basawul, 359
Basra, 238
Basra-Baghdad-Kermanshah-Teheran route, comparison of, with
Nushki-Seistan route, 237, 238
Belgian customs in Seistan, 235
Beetroot in Chimkent district, 19
Bell, Captain R. C., 241
Bellew, cited, 197
Benadar Kalan, 185
Benn, Major, 232
Ber Kazan, 10
Bibi Halima, 360, 361, 366, 369
Biggs, General Yeatman, 419
Binket (See Tashkent)
Bird, Major, 357, 358, 394, 395
Bird, General Corrie, 416
Bish Agatchski, 49
Black Sands of Bokhara (See Kara Kum)
Blood, General Sir Bindon, 417, 425
Bodorodski, 59
Bokhara, Khanate of, 25-39
City, 2, 6, 30, 36-39, 49, 52, 70-71, 104
Bazaars, 34, 44
Commercial relations, 70, 71
Imports from Kandahar, 203
Irrigation, 94
Masjid-i-Jama, 36
Medjidi Kalyan, 35
Medresse Mir-i-Arab, 36
Minai Kalan, 36
Population, 26, 29, 30, 33
Products, 29-30
Registan, 34
Soil, 29-30
Submission to Russia, 150
Walls of, 30
Water difficulty, 25, 26, 33, 72
Women in, 33, 34
Bolan pass, 230
Bombay, imports from, into Kandahar, 201-202
Bori valley, 260
Bozai Gumbaz, 85
British agent in Kabul, 374
Agent at Koh-i-Malik-Siah, 234
Interests in Persia, 220 in Seistan, 241
Merchants at Bunder Abbas, 237
Relations with Afghanistan, 147, 148, 149, 155, 156, 220, 250,
373-375, 446, 454, 457, 458
Relations with Russia, 1-3, 187, 188, 189, 448
Support of Abdur Rahman as Amir, 356
Brett, Lieutenant, 241
Brodrick, Mr. St. John, 452
Brooke, Captain Victor, 453
Brown, The Misses, 354, 395, 399
Bruce, Mr., 409
Buluna Khel, 408
Bunder Abbas, 234, 237
British merchants at, 237
Rate of camel-hire, 234
Buner, 408
Burnes, Alexander, 147-148
Burrows, General, 152, 187
Bushire, 237
Bustan, 69
Butkhak, 243

Cameron, Mr., 394


Campbell, Lieutenant, 310-311
Canals:
Angar, 48
Balungar, 65
Bos Su, 11, 59
Emperor Nicholas I., 59
Khani Yab, 114
Russki, 61
Shari Rud, 33, 73
Tchüli, 18
Tokhtamish, 79
Tumen, 10
Caspian Sea, 4, 95, 96
Cavagnari, Sir Louis, 347
Central Asian railway, 8, 11, 15, 18, 70, 75, 103, 155, 173
Chageh, 231, 232, 234, 408
Chahil Dukteran, 112, 125
Chakdara, 414, 417
Chakmakchak, 182
Charasia, 152
Chardar, 67
Charhardeh valley, 346
Charjui, 8, 74, 75, 76, 96, 97, 98, 102, 103, 104, 107, 108, 109
Charog, 86, 90, 91, 174
Chasma Sabz, 126
Chelyabinsk, 23
Chemen-i-Bed, 120
Chernaieff, General, 20, 48, 60, 61
Chernaievo, 59, 60, 61
Chigman, 49
Chilas, 408
Chiltan hills, 226
Chimkent, 6, 16, 18, 19, 20, 23
Chitral, 408, 413, 414, 415
British occupation of, 403
Military establishments of, 427
Relief of, 414
Shir Afzal, Mehtar of, 413, 414
Christie, cited, 169
Chushka, 173
Cidj Duvan, 69
Clarendon, Lord, 445
Clarke, Mr., 406
Clements, Mr., 394
Cleveland, Major, 394, 399, 354, 399
Mrs., 354, 399
Coldstream, Lieutenant, 410
Coal, 14, 396
Communications, 91, 92, 93, 329-341
Connaught, T.R.H. Duke and Duchess of, 401
Connolly, cited, 169
Copper, 14
Cotton, 30, 69, 73, 78, 117
Court, cited, 197
Cranbourne, Lord, 451
Currency, 436
Curzon, Hon. George Nathaniel, M.P., 427
Literary works of, 427
Visits Kabul, 427
Curzon of Kedleston, Lord, 426, 439, 452
Abdur Rahman’s death and, 440
Dane Mission, 453, 454, 455
Habib Ullah, 451
N.-W. F. Province, 431, 432
Reforms of, 427
Customs, Belgian, in Seistan, 235

Dakka, 359, 429


Daly, Mrs., 391, 392, 394, 395
Dane, Sir Louis, 453, 454-456
Mission, 189, 348, 353, 357, 360
Treaty, 373, 455, 456
Darband, 90
Darwaz, 25, 29, 30, 93, 244
Dawar valley, 260
Dasht-i-Margo, 221
Daulatabad, 129
Deane, Major, 425
Dehdadi, 177, 257
Dera Ismail Khan, 409, 429
Dera Ismail Khan-Kandahar, list of marches between, 335-337

You might also like