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

(Ebook) PHP jQuery Cookbook: over 60 simple but highly effective recipes to create interactive web applications using PHP with jQuery by Vijay Joshi ISBN 9781621988977, 9781849512749, 9781849512756, 162198897X, 1849512744, 1849512752 pdf download

Ebook

Uploaded by

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

(Ebook) PHP jQuery Cookbook: over 60 simple but highly effective recipes to create interactive web applications using PHP with jQuery by Vijay Joshi ISBN 9781621988977, 9781849512749, 9781849512756, 162198897X, 1849512744, 1849512752 pdf download

Ebook

Uploaded by

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

(Ebook) PHP jQuery Cookbook: over 60 simple but

highly effective recipes to create interactive


web applications using PHP with jQuery by Vijay
Joshi ISBN 9781621988977, 9781849512749,
9781849512756, 162198897X, 1849512744,
https://ebooknice.com/product/php-jquery-cookbook-over-60-simple-
1849512752 download
but-highly-effective-recipes-to-create-interactive-web-
applications-using-php-with-jquery-11793532

Explore and download more ebooks at ebooknice.com


We believe these products will be a great fit for you. Click
the link to download now, or visit ebooknice.com
to discover even more!

(Ebook) Biota Grow 2C gather 2C cook by Loucas, Jason; Viles,


James ISBN 9781459699816, 9781743365571, 9781925268492,
1459699815, 1743365578, 1925268497

https://ebooknice.com/product/biota-grow-2c-gather-2c-cook-6661374

(Ebook) Matematik 5000+ Kurs 2c Lärobok by Lena Alfredsson, Hans


Heikne, Sanna Bodemyr ISBN 9789127456600, 9127456609

https://ebooknice.com/product/matematik-5000-kurs-2c-larobok-23848312

(Ebook) SAT II Success MATH 1C and 2C 2002 (Peterson's SAT II


Success) by Peterson's ISBN 9780768906677, 0768906679

https://ebooknice.com/product/sat-ii-success-math-1c-and-2c-2002-peterson-
s-sat-ii-success-1722018

(Ebook) Master SAT II Math 1c and 2c 4th ed (Arco Master the SAT
Subject Test: Math Levels 1 & 2) by Arco ISBN 9780768923049,
0768923042

https://ebooknice.com/product/master-sat-ii-math-1c-and-2c-4th-ed-arco-
master-the-sat-subject-test-math-levels-1-2-2326094
(Ebook) Cambridge IGCSE and O Level History Workbook 2C - Depth
Study: the United States, 1919-41 2nd Edition by Benjamin
Harrison ISBN 9781398375147, 9781398375048, 1398375144,
1398375047
https://ebooknice.com/product/cambridge-igcse-and-o-level-history-
workbook-2c-depth-study-the-united-states-1919-41-2nd-edition-53538044

(Ebook) Beginning jQuery 2 for ASP.NET Developers: Using jQuery


2 with ASP.NET Web Forms and ASP.NET MVC by Bipin Joshi (auth.)
ISBN 9781430263043, 9781430263050, 1430263040, 1430263059

https://ebooknice.com/product/beginning-jquery-2-for-asp-net-developers-
using-jquery-2-with-asp-net-web-forms-and-asp-net-mvc-4634656

(Ebook) Pro PHP and jQuery by Jason Lengstorf ISBN 1430228474

https://ebooknice.com/product/pro-php-and-jquery-2090250

(Ebook) Learning PHP, MySQL & JavaScript - With jQuery, CSS &
HTML5 by Robin Nixon ISBN 9781491978917, 1491978910

https://ebooknice.com/product/learning-php-mysql-javascript-with-jquery-
css-html5-7294746

(Ebook) Master Web Design with HTML, CSS, JavaScript, and


jQuery: Create Stunning Interactive Websites by Hussain, Frahaan
& Hussain, Kameron ISBN B0CLJ15GD3

https://ebooknice.com/product/master-web-design-with-html-css-javascript-
and-jquery-create-stunning-interactive-websites-55101262
PHP jQuery Cookbook

Over 60 simple but highly effective recipes to create


interactive web applications using PHP with jQuery

Vijay Joshi

BIRMINGHAM - MUMBAI
PHP jQuery Cookbook

Copyright © 2010 Packt Publishing

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

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

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

First published: December 2010

Production Reference: 1081210

Published by Packt Publishing Ltd.


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

ISBN 978-1-849512-74-9

www.packtpub.com

Cover Image by Vinayak Chittar (vinayak.chittar@gmail.com)


Credits

Author Editorial Team Leader


Vijay Joshi Aanchal Kumar

Reviewers Project Team Leader


Anis Ahmad Ashwin Shetty
Md. Mahmud Ahsan
Project Coordinator
Joe Wu
Michelle Quadros
Shameemah Kurzawa
Proofreader
Acquisition Editor Mario Cecere
Chaitanya Apte
Indexer
Development Editor Hemangini Bari
Neha Mallik
Production Coordinator
Technical Editors Aparna Bhagat
Mohd. Sahil
Hithesh Uchil Cover Work
Aparna Bhagat
About the Author

Vijay Joshi is a programmer with over six years of experience on various platforms. He
discovered his passion for open source four years ago when he started playing with PHP on a
hobby project after completing his Masters in Computer Applications. Vijay is a professional
web developer now and prefers writing code ONLY in open source (but that does
not always happen, unfortunately!). He switches hats as needed—he is full-time lead
programmer at Philogy, independent consultant for a few selected companies where he
advises them on a variety of Internet-based initiatives, and still remains an active blogger
at http://vijayjoshi.org.

Besides his work, he enjoys reading, trekking, and sometimes getting obsessed with fitness.

Writing a book is a long and complicated task which requires the support
and coordination of many people. I am thankful to the entire team at Packt,
especially Michelle, Chaitanya, and Neha for being so cooperative and
patient with me.

This book is dedicated to all open source developers, contributors, and


enthusiasts around the world who have made PHP and jQuery the leading
programming tools in their niche. A big thank you to you guys. I am feeling
both proud and excited to be able to contribute to the community that gave
me so much to learn.

On a personal note, I would like to thank my parents, my brother Ajay, and


Sheethal for their support and encouragement.

A special thanks to Ravindra Vikram Singh for helping me get started on


this project.
About the Reviewers

Md. Mahmud Ahsan graduated in Computer Science & Engineering from the International
Islamic University Chittagong (IIUC) in Bangladesh. He is a Zend Certified Engineer and
expert in developing web applications, Facebook applications, Mashup applications, and
iPhone-native applications. Besides his full time job, he blogs at http://thinkdiff.net
and writes articles on different technologies, especially Facebook applications development.
He lives in Bangladesh with his wife Jinat.

Currently, Mahmud works as a Software Engineer (remote developer) in i2we inc. (867 Avalon,
Lafayette, CA) where he develops social web applications using PHP, MySQL, JavaScript, Zend
Framework, CodeIgniter, jQuery, and Mashup APIs. He also leads various small to medium
level projects.

Mahmud is also an Indie iPhone application developer and publishes his own applications at
http://ithinkdiff.net.

He was a technical reviewer of the Zend Framework 1.8 Web Application Development
book by Packt Publishing.

I’m very grateful to my father who bought a computer for me in 2001. Since
then, I have loved programming and working with various technologies.
Joe Wu is a full-time Senior PHP Web Developer, and has been in the industry since 2005.
He has worked on various projects of all sizes and is familiar with most of the open source
technologies surrounding PHP web development.

Joe is always enthusiastic about new and upcoming technologies and is keen to learn and
pick up new skill-sets wherever possible and utilize them in his current or future projects. He
is also keen to learn about new opportunities and innovative ideas out there, and believes
that the market is always wide open for new and upcoming innovations to improve our way
of living.

Aside from all the technological computer work, Joe is a professional badminton player and
manages to somehow fit a near full-time training schedule together with his full-time job. Joe's
best ranking of 59th in the world in singles and the attendance of the Commonwealth Games
Delhi 2010 means that he has equally as much experience in badminton and web developing.

Aside from all the endeavors, Joe also works for his own company (with his business partner)
to put his skills and experience to good use and to help anyone who needs assistance with
web development.

Wackyinnovation (www.wackyinnovation.com) promotes the concept of always moving


forward and coming up with and utilizing new technologies and ideas. Their always
enthusiastic and can-do attitude ensures jobs are done to perfection with an innovative
edge on their competitors.

Shameemah Kurzawa has been programming since she was at high school. Being
motivated to be a Systems Analyst, she pursued both undergraduate and postgraduate
studies in Business Information System and Software Engineering, respectively.

She has been working as a Web Developer/Analyst for the past five years, for a renowned
company SBS (Special Broadcasting Service) in Australia. Besides work, she enjoys spending
her time with her family (she is the mum of a little two year old baby boy) and enjoys travelling
as well as investigating new technologies.

I would like to thank my husband, my son, and the Packt Publishing team for
their support and understanding in reviewing this book.
www.PacktPub.com

Support files, eBooks, discount offers,


and more
You might want to visit www.PacktPub.com for support files and downloads related to
your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub
files available? You can upgrade to the eBook version at www.PacktPub.com and as a print
book customer, you are entitled to a discount on the eBook copy. Get in touch with us at
service@packtpub.com for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up
for a range of free newsletters and receive exclusive discounts and offers on Packt books
and eBooks.

http://PacktLib.PacktPub.com

Do you need instant solutions to your IT questions? PacktLib is Packt’s online digital book
library. Here, you can access, read and search across Packt’s entire library of books.

Why Subscribe?
 Fully searchable across every book published by Packt
 Copy & paste, print and bookmark content
 On demand and accessible via web browser

Free Access for Packt account holders


If you have an account with Packt at www.PacktPub.com, you can use this to access
PacktLib today and view nine entirely free books. Simply use your login credentials for
immediate access.
Table of Contents
Preface 1
Chapter 1: Handling Events with jQuery 7
Introduction 7
Executing functions when page has loaded 8
Binding and unbinding elements 9
Adding events to elements that will be created later 14
Submitting a form with jQuery 16
Checking for missing images 18
Creating the select/unselect all checkboxes functionality 21
Capturing mouse events 25
Creating keyboard shortcuts 28
Displaying user selected text 31
Dragging elements on a page 36
Chapter 2: Combining PHP and jQuery 41
Introduction 41
Fetching data from PHP using jQuery 43
Creating a query string automatically for all form elements 47
Detecting an AJAX request in PHP 50
Sending data to PHP 52
Aborting AJAX requests 56
Creating an empty page and loading it in parts 59
Handling errors in AJAX requests 63
Preventing browser from caching AJAX requests 67
Loading JavaScript on demand to reduce page load time 68
Chapter 3: Working with XML Documents 73
Introduction 73
Loading XML from files and strings using SimpleXML 76
Accessing elements and attributes using SimpleXML 79
Table of Contents
Searching elements using XPath 83
Reading an XML using DOM extension 88
Creating an XML using DOM extension 92
Modifying an XML using DOM extension 94
Parsing XML with jQuery 98
Chapter 4: Working with JSON 103
Introduction 103
Creating JSON in PHP 105
Reading JSON in PHP 107
Catching JSON parsing errors 109
Accessing data from a JSON in jQuery 112
Chapter 5: Working with Forms 119
Introduction 119
Adding input fields dynamically in a form 120
Searching for user-inputted string in a page 123
Checking for empty fields using jQuery 127
Validating numbers using jQuery 131
Validating e-mail and website addresses using regular expressions 134
Displaying errors as user types: Performing live validation 138
Strengthening validation: validating again in PHP 143
Creating a voting system 149
Allowing HTML inside text areas and limiting HTML tags that can be used 154
Chapter 6: Adding Visual Effects to Forms 159
Introduction 159
Creating a Tic-Tac-Toe game with effects 160
Informing a user while an AJAX request is in progress 167
Creating expandable and collapsible boxes (accordion) 172
Fading an element after updating it 177
Floating box on demand 180
Updating items in a shopping cart 184
Chapter 7: Creating Cool Navigation Menus 193
Introduction 193
Creating a basic drop-down menu 194
Creating a menu that changes background on mouse-over 198
Creating an accordion style menu 200
Creating a floating menu 206
Creating an interface for tabbed navigation 211
Adding more tabs 216
Creating a wizard using tabs 221

ii
Table of Contents

Chapter 8: Data Binding with PHP and jQuery 229


Introduction 229
Fetching data from a database and displaying it in a table format 230
Collecting data from a form and saving to a database 236
Filling chained combo boxes that depend upon each other 241
Checking username availability from database 247
Paginating data for large record sets 252
Adding auto-suggest functionality to a textbox 258
Creating a tag cloud 266
Chapter 9: Enhancing your Site with PHP and jQuery 273
Introduction 273
Sending cross-domain requests using server proxy 274
Making cross-domain requests with jQuery 280
Creating an endless scrolling page 286
Creating a jQuery plugin 291
Displaying RSS feeds with jQuery and PHP 296
Appendix: Firebug 301
Introduction 301
Inspecting elements 303
Editing HTML and CSS 305
Debugging JavaScript 307
Index 311

iii
Preface
Nowadays, web applications are behaving more and more like desktop applications with
lesser page loads and more user interaction and effects. The Web has become faster and
applications such as Gmail and Facebook have given a new meaning to web applications.

PHP on the server side and jQuery on the client side (browser) are a killer combination for
developing interactive web applications. PHP is the leading language of choice among web
developers and jQuery is now used on more than one-third of the top 1000 sites on the
internet and is the most widely-used library.

One thing that PHP and jQuery have in common is that they are easy to learn. Once you know
the basics, you can promote yourself to the next level easily.

And this is what the book will do for you. It is like a toolbox having a myriad of tools inside.
It will allow you to write faster web applications, which feel like desktop applications, with
the help of PHP and jQuery. Whether you want to learn live validations, create plugins, drag
elements, create a menu, watch videos using YouTube API, or interact with the database, just
jump to the respective recipe for the solution. AJAX, a key feature of rich internet applications,
is also covered in detail.

You are not required to read this book from the beginning to the end. Each recipe is
independent and is like a "how to" or a mini application in itself. You can directly look
for a solution to a specific problem.

I hope you will find this book useful and that it will help you to take your skills to a higher level.

What this book covers


Chapter 1, Handling Events with jQuery, helps you understand jQuery's cross-browser event
handling methods. You will learn to work with keyboard and mouse events. Advance event
handling topics, such as dragging and keyboard shortcuts are also discussed.

Chapter 2, Combining PHP and jQuery, lists several ways of sending AJAX requests using
jQuery and also describes how PHP responds to such requests. This chapter also contains
recipes that deal with caching of AJAX requests and error handling during AJAX requests.
Preface

Chapter 3, Working with XML Documents, explains working with XML files in PHP as well as
jQuery. Recipes will describe how to read, write, and modify XMLs using DOM and SimpleXML
extensions of PHP. Parsing XML with jQuery is also discussed.

Chapter 4, Working with JSON, discusses JSON in detail. You will be shown how to read and
write JSON data in PHP, and also explore jQuery's inbuilt capabilities of parsing JSON.

Chapter 5, Working with Forms, deals with forms and form validations. You will learn how to
validate forms for different types of data with jQuery. This will cover validating empty fields,
numbers, e-mail addresses, web addresses, and much more. Server-side validation methods
will also be discussed to make validations more powerful.

Chapter 6, Adding Visual Effects to Forms, extends the previous chapter and provides recipes
for adding visual effects to forms. Recipes in this chapter allow you to create user-friendly
forms by adding effects, such as highlighting, fading, expandable boxes, and various others.

Chapter 7, Creating Cool Navigation Menus, describes the creation of different types of
menus, such as animated menus, accordions, and tabbed menus. Advanced techniques for
creating tabs are also covered that will guide you in adding and removing tabs on the fly.

Chapter 8, Data Binding with PHP and jQuery, explains, in detail, how a database can be used
along with PHP and jQuery. Examples included in this chapter will explain how to fetch data
from the database and use it in web forms.

Chapter 9, Enhancing your Site with PHP and jQuery, teaches you some advanced techniques
of PHP and jQuery. It will show how to overcome browser restrictions like
cross-domain requests. You will learn to create a jQuery plugin for custom use and an
endless scrolling page among other things.

Appendix, Firebug, explains the use of Firebug for debugging HTML and JavaScript in web
pages. You will learn how to edit HTML and change the appearance of pages on the browser
itself without switching to actual code files. You will be able to execute JavaScript directly from
Firebug and further understand debugging JavaScript using this add-on.

What you need for this book


You should have Apache (or another web server), PHP (version 5.0 or above), and MySQL
installed on your system to be able to run the examples in this book. You can install them
all at once using software such as WampServer or you can install them separately. jQuery
(version 1.3.2 or higher) will also be required.

In terms of technical proficiency, this book assumes that you have working knowledge of PHP,
jQuery, HTML, and CSS. You need to know only the basics of these, leave the rest to this book.


Preface

Who this book is for


This book is for PHP and jQuery developers who just know the basics of these two and want
to use PHP and jQuery together to create rich internet applications. It provides a large number
of examples in each chapter that will take you from being a basic developer to a pro by giving
step-by-step instructions for each task in developing web applications using PHP and jQuery.

Conventions
In this book, you will find a number of styles of text that distinguish between different kinds of
information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text are shown as follows: "The input button has also been attached
to a click event."

A block of code is set as follows:


$('input:text').bind(
{
focus: function()
{
$(this).val('');
},
blur: function()
{
$(this).val('Enter some text');
}
});

New terms and important words are shown in bold. Words that you see on the screen, in
menus or dialog boxes for example, appear in the text like this: "Now click on the Create
New Element button a few times to create some DIV elements".

Warnings or important notes appear in a box like this.

Tips and tricks appear like this.


Preface

Reader feedback
Feedback from our readers is always welcome. Let us know what you think about this
book—what you liked or may have disliked. Reader feedback is important for us to develop
titles that you really get the most out of.

To send us general feedback, simply send an e-mail to feedback@packtpub.com, and


mention the book title via the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the
SUGGEST A TITLE form on www.packtpub.com or e-mail suggest@packtpub.com.

If there is a topic that you have expertise in and you are interested in either writing or
contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support
Now that you are the proud owner of a Packt book, we have a number of things to help you
to get the most from your purchase.

Downloading the example code for this book


You can download the example code files for all Packt books
you have purchased from your account at http://www.
PacktPub.com. If you purchased this book elsewhere, you
can visit http://www.PacktPub.com/support and
register to have the files e-mailed directly to you.

Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do happen.
If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be
grateful if you would report this to us. By doing so, you can save other readers from frustration
and help us improve subsequent versions of this book. If you find any errata, please report them
by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata
submission form link, and entering the details of your errata. Once your errata are verified, your
submission will be accepted and the errata will be uploaded on our website, or added to any list
of existing errata, under the Errata section of that title. Any existing errata can be viewed
by selecting your title from http://www.packtpub.com/support.


Preface

Piracy
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt,
we take the protection of our copyright and licenses very seriously. If you come across any
illegal copies of our works, in any form, on the Internet, please provide us with the location
address or website name immediately so that we can pursue a remedy.

Please contact us at copyright@packtpub.com with a link to the suspected


pirated material.

We appreciate your help in protecting our authors, and our ability to bring you
valuable content.

Questions
You can contact us at questions@packtpub.com if you are having a problem with any
aspect of the book, and we will do our best to address it.


Handling Events with
1
jQuery
In this chapter, we will cover:

 Executing functions when a page has loaded


 Binding and unbinding elements
 Adding events to elements that will be created later
 Submitting a form using jQuery
 Checking for missing images
 Creating a select/unselect all checkbox functionality
 Capturing mouse movements
 Creating keyboard shortcuts
 Displaying user-selected text
 Dragging elements on a page

Introduction
Events are actions that execute some JavaScript code for producing the desired result. They
can be either some sort of manipulation of a document or some internal calculations.

Since different browsers handle events differently, it takes a lot of effort to write JavaScript
code that is compatible with all browsers. This chapter will help you understand event
handling and explore related methods of jQuery that can make scripts compatible on different
browsers. You will learn to work with the keyboard and mouse events. Advanced event
handling topics like dragging and keyboard shortcuts are also discussed.
Random documents with unrelated
content Scribd suggests to you:
in getting the lowest figures for his road, and the large amount of
his purchases enables him to secure the best rates. And last, but not
least, in matters where dishonesty would find so great opportunities,
it is safer to concentrate responsibility than to diffuse it.
As I shall not again refer to this department, what remains of
interest for me to say about it will be said here. As an adjunct to it,
storehouses are established at central points in which stocks of
articles in ordinary use are kept on hand. Whenever supplies are
wanted in any other department—as, for instance, a bell-cord and
lantern by a conductor—requisitions are presented, approved by a
designated superior. These requisitions state whether the articles are
to be charged to legitimate wear and tear, and if so, whether to the
passenger or the freight service, and of which subdivision of the
road; or whether they are to be charged to the conductor for other
articles not properly accounted for. Without going into further detail,
it can be readily seen how the comptroller's office can, at the end of
each month, from these requisitions, have a complete check upon all
persons responsible for the care of property. The purchasing agent,
too, from his familiarity with prices, is usually charged with the sale
of all condemned and worn-out material.[14]
Before returning to a more detailed review of the operating
departments of a railroad, its legal department requires a few words.
Not only is a railroad corporation, being itself a creation of the law,
peculiarly bound to conform all its actions to legal forms and tenets,
but it is also a favorite target for litigation. The popular prejudice
against corporations, it may be said in passing, is utterly illogical.
The corporation is the poor man's opportunity. Without it he could
never share in the gains and advantages open to capital in large
sums. With it a thousand men, contributing a thousand dollars each,
compete on equal terms with the millionaire. Its doors are always
open to any who may wish to share its privileges or its prosperity,
and no man is denied equal participation according to his means and
inclinations. It is the greatest "anti-poverty" invention which has ever
been produced, and the most democratic. But, for all that, instead of
possessing the unbounded power usually ascribed to it, no creature
of God or man is so helpless as a corporation before the so-called
great tribunal of justice, the American jury. It may not be literally
true that a Texas jury gave damages to a tramp against a certain
railroad because a section-master's wife gave him a meal which
disagreed with him, but the story can be nearly paralleled from the
experience of many railroads. Hence settlements outside of the law
are always preferred where they are at all possible, and an essential
part of an efficient legal organization is a suitable man always ready
to repair promptly to the scene of any loss or accident, to examine
the circumstances with the eye of a legal expert on liabilities.
But the management of claims, and of loss and damage suits,
though a large part, is by no means all of the legal business
connected with a railroad. Every contract or agreement should pass
under scrutiny of counsel, and in the preparation of the various
forms of bonds, mortgages, debentures, preferred stocks, etc.,
which the wants of the day have brought forth, the highest legal
talent finds employment. For, as development has multiplied the
types of cars and engines to meet special wants, so have a great
variety of securities been developed to meet the taste and prejudices
of investors of all nations. There is, in fact, a certain fashion in the
forms of bonds, and the conditions incorporated in mortgages, which
has to be observed to adapt any bond to its proposed market.
We shall now
return to the
operating
departments
under their
respective
heads, and
glance briefly at
the methods
and detail
pursued in
each. On roads
of large mileage the general manager is assisted by general or
division superintendents in charge of roadway, motive power, and
trains of one or more separate divisions; but for our purposes we
may consider the different departments without reference to these
superintendents.

The superintendent of roadway or chief


engineer comes first, having charge of track,
bridges, and buildings. In his
office are collected maps of all
important stations and junction
points, kept up to date with
changes and additions; scale
drawings of all bridges and
trestles, of all standard depots,
tanks, switches, rails, fastenings,
signals, and everything
necessary to secure uniformity
of patterns and practice over the
entire road. Under him are
supervisors of bridges and
supervisors of road, each
assigned to a certain territory. The supervisors of bridges make
frequent and minute examinations of every piece or member of
every bridge and trestle, report in advance all the repairs that
become necessary, and make requisition for the material needed.
A Type of Snow-plough.

Under the bridge supervisor are organized "bridge gangs," each


consisting of a competent foreman with carpenters and laborers
skilled in bridge work and living in "house" or "boarding" cars, and
provided with pile-drivers, derricks, and all appliances for handling
heavy timbers and erecting, tearing down, and repairing bridges.
These cars form a movable camp, going from place to place as
needed, and being side-tracked as near as possible to the work of
the gang. Long experience begets great skill in their special duties,
and the feats which these gangs will perform are often more
wonderful than many of the more showy performances of railroad
engineering. It is an every-day thing with such gangs to take down
an old wooden structure, and erect in its place an iron one, perhaps
with the track raised several feet above the level of the original,
while fifty trains pass every day, not one of which will be delayed for
a moment.
A Rotary Steam Snow-shovel in Operation.
(From an instantaneous photograph.)

Each of the supervisors of road has his assigned territory divided


into "sections," from five to eight miles in length. At a suitable place
on each section are erected houses for a resident section-master
and from six to twelve hands. These are provided with hand- and
push-cars, and spend their whole time in keeping their sections in
good condition. Upon many roads annual inspections are made and
prizes offered for the best sections. At least twice a day track-
walkers from the section-gangs pass over the entire line of road. To
simplify reports and instructions, frequently every bridge or opening
in the track is numbered, and the number displayed upon it; and
every curve is also posted with its degree of curvature and the
proper elevation to be given to the outer rail.
The work of the section-men is all done under regular system. In
the spring construction-trains deliver and distribute ties and rails on
each section, upon requisitions from supervisors. Then the section-
force goes over its line from end to end, putting in first the new ties
and then the new rails needed. Next the track is gone over with
minute care and re-lined, re-surfaced, and re-ballasted, to repair the
damages of frost and wet, the great enemies of a road-bed. Then
ditches, grass, and the right-of-way have attention. These processes
are continually repeated, and especially in the fall in preparation for
winter. During the winter as little disturbance of track is made as
possible, but ditches are kept clean, and low joints are raised by
"shims" on top of joint ties. Essential parts of the equipment of any
large road are snow-ploughs (pp. 154–5–6) and wrecking cars, with
powerful derricks and other appliances for clearing obstructions.
When wrecks or blockades occur these cars, with extra engines,
section-hands, bridge gangs, and construction-trains, are rushed to
the spot, and everything yields to the work of getting the road clear.
We come next to the
superintendent of
machinery, whose duty it is
to provide and maintain
locomotives and cars of all
kinds to handle the
company's traffic. His
department is subdivided
between a master
mechanic, in charge of
locomotives and machine-
shops, and a master car-
builder, in charge of car-
shops.
The master mechanic
selects and immediately
controls all engine-runners
and firemen, and keeps Railway-crossing Gate.
performance sheets of all
locomotives, showing miles run, cars hauled, wages paid, coal and
oil consumed, and other details giving results accomplished by
different runners and firemen, and by different types of engine, or
on different divisions or roads. Premiums are often paid the runners
and firemen accomplishing the best results.
Report of Performance of Engines, Repairs, and all other Costs
Incident thereto, for the fiscal year ending June 30th, 1888.

[Key for column headings. Column A has been repeated in each


Part.]

A. Number of Engine.
B. Passenger
C. Freight.
D. Gravel or Construction.
E. Switching.
F. Total.
G. Eighth Cords of wood.
H. Bushels Coal.
I. Cost of Fuel.
[Table—Part 1 of 4]

Miles Run. Fuel.

A. B. C. D. E. F. G. H. I.

1 — 12,084 4,253 64 16,401 118 10,699 $1,090.25


2 — 2,672 11,779 954 15,405 193 10,913 1,131.77
3 5,402 14,471 408 120 20,407 189 10,590 1,101.08
4 28,643 4,168 — — 32,811 297 11,875 1,212.20
5 28,275 4,490 — 72 32,837 301 12,961 1,335.31
6 — — — 32,370 32,370 33 10,360 1,042.26
8 3,229 11,799 4,779 — 19,807 150 13,233 1,356.30
9 1,050 23,203 — — 24,253 155 16,344 1,663.41
10 874 24,729 — 96 25,699 158 17,039 1,741.67
11 — — — 23,609 23,609 205 7,661 811.00
12 1,527 — 4,369 12,060 17,956 142 8,875 918.75
30 41,345 — — — 41,345 237 17,702 1,821.37
31 37,450 — — — 37,450 215 16,695 1,716.56
32 4,233 13,516 — 120 17,869 115 10,918 1,117.10
34 13,742 5,217 — 1,224 20,183 149 6,691 704.07
165,770 116,349 25,588 70,695 378,402 2657 182,556 $18,768.13
A. Number of Engine.
J. Gallons of Engine Oil.
K. Signal Oil.
L. Head-Light Oil.
M. Lbs. of Cyl. Oil.
N. Car Grease.
O. Waste.
P. Packing.
Q. Gallons Kerosene.
[Table—Part 2 of 4]

Oil, Waste and Other Stores.

A. J. K. L. M. N. O. P. Q.

1 124 10 29 59½ 45 347 72 –


2 121½ 13½ 35½ 69½ 69 466 102 2
3 132½ 10½ 38 74½ 69 350 61 –
4 258 14 49 125 106 659 76 –
5 256 12 39 99½ 75 622 82½ –
6 30½ 12½ 188½ 111¼ — 298 160½ –
8 134 10½ 41 65¼ 60 327 98 –
9 135 12½ 45½ 73 70 374 87 –
10 131½ 13½ 63 69 70 372 96 –
11 136 1¾ 96 81 40 354 81 2
12 105 9¼ 58 95½ 20 360 75 –
30 223 23¾ 44½ 69 106 726 51 –
31 243 15¼ 46 92 110 660 68 1
32 138 10½ 41 71½ 130 361 63 7
34 186 10 32 71 75 409 43 2
2,554 179½ 846 1,226½ 1045 6685 1214 14
A. Number of Engine.
R. Cost of Stores.
S. Wages of Engineer and Fireman.
T. Cost of Cleaning.
U. Labor.
V. Material.
W. Total Cost of Repairs.
X. Total Expenses and Repairs.
[Table—Part 3 of 4]

Cost of Repairs.

A. R. S. T. U. V. W. X.

$ $ $ $
1 $ 87.64 $ 66.32 $ 289.72
1,293.80 115.00 223.40 2,876.41
2 106.85 1,646.90 82.50 69.65 75.14 144.79 3,112.81
3 93.85 1,489.65 187.50 178.25 63.61 241.86 3,113.94
4 171.85 1,719.55 212.50 203.95 100.13 304.08 3,620.18
5 144.86 1,628.80 202.00 240.55 114.98 355.53 3,666.50
6 173.92 1,884.50 10.00 172.35 63.65 236.00 3,346.68
8 97.34 1,593.05 150.00 110.75 106.69 217.44 3,414.13
9 108.53 1,625.80 200.00 139.80 175.48 315.28 3,918.02
10 108.38 1,669.55 205.00 207.55 109.78 317.33 4,041.93
11 111.83 1,126.75 5.00 413.95 89.76 503.71 2,558.29
12 106.31 1,405.10 25.00 37.45 27.17 64.62 2,519.78
30 142.71 1,719.56 212.50 144.50 77.52 222.02 4,118.15
31 152.16 1,554.55 205.00 642.50 432.86 1,075.36 4,703.66
32 108.40 1,186.40 172.00 1,729.70 438.40 2,168.10 4,752.00
34 108.40 1,186.40 137.00 1,522.10 781.64 2,303.74 4,313.48
1,823.80 22,603.45 2,121.00 6,036.45 2,723.13 8,759.58 54,075.96
A. Number of Engine.
Y. Bushel Coal.
Z. Gal. Engine Oil.
AA. Pound of Tallow.
BB. Repairs.
CC. Fuel.
DD. Stores.
EE. Wages E. and F.
FF. Cleaning.
GG. Total.
HH. Car Mileage.
[Table—Part 4 of 4]

M'ls run to one. Cost per Mile Run For.

A. Y. Z. AA. BB. CC. DD. EE. FF. GG. HH.

1 1.5 122.3 34.5 01.76 06.64 00.53 07.89 00.61 17.43 177,659
2 1.1 126.8 27.7 00.94 07.34 00.69 10.69 00.53 20.19 197,203
3 0.9 77.7 17.4 02.32 10.58 00.90 14.31 02.04 30.15 182,402
4 2.7 127.2 32.8 00.92 03.69 05.23 05.24 00.64 15.72 139,422
5 2.5 128.2 41.2 01.08 04.06 00.44 04.96 00.61 11.15 135,780
6 3.1 140.4 36.3 00.72 03.22 00.53 05.82 00.03 10.32 —
8 1.5 147.8 37.9 01.09 06.84 00.49 08.04 00.76 17.22 305,024
9 1.4 150.0 48.5 01.30 06.88 00.40 06.70 00.82 16.10 383,682
10 1.5 195.4 46.5 01.23 06.77 00.31 06.49 00.79 15.59 409,035
11 3.0 173.6 36.4 02.13 03.43 00.47 04.77 00.02 10.82 —
12 2.0 171.0 23.5 00.36 05.11 00.59 07.82 00.14 14.02 66,834
30 2.3 185.4 74.9 00.53 04.40 00.34 04.15 00.51 09.93 231,554
31 2.2 154.1 50.8 02.87 04.58 00.40 04.15 00.54 12.54 202,289
32 1.6 129.5 31.2 12.11 06.25 00.60 06.64 00.96 26.56 184,083
34 3.2 108.5 35.5 11.41 03.48 00.54 05.29 00.67 21.39 107,060
2.5 148.1 38.5 02.31 04.98 00.48 05.97 00.55 14.29 2,722,027

The master car-builder has charge of the shops where cars are
built and repaired, and of the car-inspectors who are stationed at
central and junction points to prevent defective cars being put into
the trains.
Formerly each railroad used its own cars exclusively, and through
freights were transferred at every junction point. This involved such
delay and expense that railroads now generally permit all loaded
cars to go through to destination without transfer, and allow each
other a certain sum for the use of cars. Usually this is about three-
quarters of a cent for each mile which the car travels on a foreign
road. This involves a great scattering of cars, and an extensive
organization to keep record of their whereabouts and of the
accounts between the companies for mileage.[15] This organization
will be referred to more fully in connection with the department of
transportation. But the joint use of each other's cars makes it
necessary that there should be at least enough similarity in their
construction and their coupling appliances to permit their
indiscriminate use upon all roads. And conventions of master car-
builders have recommended certain forms and dimensions as
standards, which are now in general use.
There is much convenience in this, but one disadvantage. It
requires almost unanimous action to introduce any change of form
or of construction, however advantageous it may be. And to secure
unanimous action in such matters is almost as hard as it would be to
secure unanimity in a change in the spelling of English words. Still
there is progress, though slow, toward several desirable reforms, the
most important of which is the adoption of a standard automatic
coupler (see p. 142).
Having shown how the property of all kinds is kept in efficient
condition, we next come to its operation. This is called "conducting
transportation," and the officer in charge is usually called the
superintendent of transportation. All train-despatchers, conductors,
train-men, and telegraph operators are under his immediate control.
He makes all schedules and provides all extra and irregular service
that the traffic department makes requisition for, himself calling upon
the superintendent of machinery for the necessary locomotives,
switching engines, and cars. It is his especial province to handle all
trains as swiftly as possible, and to see that there are no collisions.
It is impossible to detail fully the safeguards and precautions used to
this end, but the general principles observed are as follows:
First, a general time-table or schedule is carefully made out for all
regular trains upon each division, showing on one sheet the time of
each train at each station.
This schedule is all that is needed so long as all trains are able to
keep on time, and there are no extras. Trouble begins when regular
trains cannot keep on schedule, or when extra trains have to be sent
out, not provided for on the schedule. A diagram, or graphic
representation of this schedule, upon a board or large sheet of
paper, is an important feature of the office regulating train-
movements. Twenty-four vertical lines divide the board into equal
spaces representing the twenty-four hours of the day, numbered
from midnight to midnight. Horizontal lines at proportionate
distances from the top represent the stations in their order between
the termini, represented by the top and bottom lines of the diagram.
The course of every train can now be plotted on this diagram in an
oblique line joining the points on each station line corresponding to
the time the train arrives at and leaves that station. The cut on the
opposite page will illustrate. It represents a road 130 miles long from
A to N, with intermediate stations B, C, D, etc., at different distances
from each other, and six trains are shown as follows:
A passenger train, No. 1, leaving A at 12 midnight and arriving at
N at 4.05 A.M. A fast express, No. 2, leaving N at 12.45 and arriving
at A at 3.30. A local passenger train, No. 4, which leaves N at 1.15,
runs to E by 4 A.M., stops there until 4.10, and returns to N by 7 A.M.;
being called No. 3 on the return, as the direction is always indicated
by the train-number's being odd or even. No. 5 is a way freight,
leaving A at 12.05 and making long stops at each station. No. 6 is an
opposing train of the same character.
Diagram Used in Making Railway Time-Tables.

The diagram shows at a


glance how, when, and
where all these trains meet
and pass each other, and
where every train is at any
moment. Should it be
desired to send an extra
train at any time, a line
drawn or a string stretched
on the board will indicate
what opposing trains must
be guarded against. For
instance, to send an extra
through in three hours,
leaving A between 1 and 2
A lamp swung across the track is the signal to stop. A.M.,
a trial line will show
that Nos. 5, 2, 4, and 6
must all be met or passed, and as (on a single-track road) this can
only be done at stations, the extra must leave at 1.35 A.M., pass No.
5 at E, meet No. 2 at F, No. 4 at I, and No. 6 at J. A dotted line on
the diagram indicates its run, and that No. 2 is held at F for 5
minutes to let it pass. If the road is double-tracked, only trains going
in the same direction need be regarded.[16]
But the more usual way of handling
extra trains, when circumstances will
permit, is to let them precede or
follow a regular train upon the same
schedule. The train is then said to be
run in "sections," and a ten minutes'
interval is allowed between them.
That opposing trains may be informed,
the leading section (and when there
are more than two all but the last)
wears on its locomotive two green
flags by day and two green lights by
night, indicating that a train follows
which is to be considered as a part of
the train leading, and having the same
rights.
So far the rules are very simple, and A lamp raised and lowered vertically is
they would be all that is necessary if the signal to move ahead.
all trains could always be kept exactly
on time. But as that cannot be, provision must be made for all the
complications which will result. The first and most important rule is
that no train must ever, under any circumstances, run ahead of time.
The next is that any train making a stop not on its schedule must
immediately send out flagmen with red flags, lights, and torpedoes
to protect it. This rule is a very difficult one to enforce without rigid
discipline, and its neglect is the cause of a large percentage of the
accidents "that will
happen." The flagman
who must go to the rear,
often a half-mile, at night,
across trestles and in
storms, must frequently
be left behind, to take his
chances of getting home
by being picked up by a
following train. There is no
one to watch him, and he
will often take chances,
and not go as far back or
as fast as he should; and
if all goes well no one is
ever the wiser.
A lamp swung vertically in a circle across the track, Now, when a train is
when the train is standing, is the signal to move back. prevented from arriving on
time at its meeting-point, we
must have some rules by
which the opposing train may
proceed, or all business on
the road would be suspended
by the delay of a single train.
Only the general principles of
these rules can be stated
within limits. They are as
follows:
1. All freight trains must
wait indefinitely for all
passenger trains.
2. When one train only is
behind time, the opposing A lamp swung vertically in a circle at arm's length
train of the same class will across the track, when the train is running,
wait for it a specified time, is the signal that the train has parted.
usually ten minutes, and five
minutes more for possible variation of watches, then go ahead,
keeping fifteen minutes behind its schedule.
3. But should such a train, running on delayed time, lose more
time, or in any other way should both trains get behind time, then
the one which is bound in a certain direction—for instance, north—
has the right to the track, and the other must lie by indefinitely.
The General Despatcher.

These principles, duly observed, will prevent collisions, but they


will often cause trains to lose a great deal of time. The train-
despatcher, therefore, has authority to handle extra and delayed
trains by direct telegraphic order. Every possible precaution is taken
to insure that such orders are received and correctly understood. As
there are great advantages following uniformity of usages and rules
among connecting roads, after years of conference, in conventions
and by committees, approved forms of all running rules and signals
have recently been adopted and are now in very general use over
the United States. Yet, in spite of all possible precautions, accidents
will sometimes happen. Richard Grant White gave a name to a
mental habit which, in train-despatchers, has caused many fatal
accidents. It is "heterophemy," or thinking one thing while saying,
hearing, or reading another. A case within my knowledge, which cost
a dozen lives, was as follows: Two opposing trains were out of time,
and the train-despatcher wished to have them meet and pass at a
certain station we will call "I," as Nos. 1 and 2 are represented as
doing on the diagram (see diagram of schedule board, p. 161). So
he telegraphed the following message, to be delivered to No. 1 at
"H" and to No. 2 at "J": "Nos. 1 and 2 will meet at 'I.'" This message
was correctly received at "J" and delivered to No. 2. But at "H" the
operator had just sold a passenger a ticket to "K," and, getting this
name in his head, he wrote out the message: "Nos. 1 and 2 will
meet at 'K.'" But the mistake was not yet past correction. The
operator had to repeat the message back to the despatcher, that the
latter might be sure it was correctly understood. He repeated it as
he had written it—"K." But the despatcher was also
"heterophemous." He saw "K," but he thought "I," and replied to the
operator that the message was O. K.
Entrance Gates at a Large Station.

So it was delivered to No. 1, and that train left "H" at full speed,
expecting to run thirty-five miles to "K" before meeting No. 2. There
was no telegraph office at "I," and there were no passengers to get
off or on, and it passed there without stopping, and three miles
below ran into No. 2 on a curve.
By one of those strange impulses which seem to come from some
unconscious cerebration, the train-despatcher meanwhile had a
feeling that something was wrong, and looked again at the message
received from "H" and discovered his mistake. But the trains were
then out of reach. He still hoped that No. 2 might arrive at "I" first,
or that they might meet upon a straight portion of road, and as the
time passed he waited at the instrument in a state of suspense
which may be imagined. When the news came he left the office, and
never returned.
Double tracks make accidents of this character impossible; but
introduce a new possibility, that a derailment from any cause upon
one track may obstruct the other track so closely ahead of an
opposing train that no warning can be given.
Central Switch and Signal Tower.

Where trains become


very numerous
additional safeguards
are added by multiplying
telegraph stations at
short intervals, and giving them conspicuous signals of semaphore
arms and lanterns, until finally the road is divided into a number of
so-called "blocks" of a few miles each; and no train is permitted to
enter any block until the train preceding has passed out. And in the
approaches to some of our great depots, where trains and tracks
are multiplied and confused with cross-overs and switching service,
all switches are set and all movements controlled by signals from a
single central tower. Sometimes, by very expensive and
complicated apparatus, it is made mechanically impossible to open
a track for the movement of a train without previously locking all
openings by which another train might interfere. The illustrations
on pages 169, 171, and above will serve to give some general idea
of these appliances.[17]
Mantua Junction, West Philadelphia, showing a Complex System of Interlacing Tracks.

There remains one other branch of the duties of the master of


transportation—the proper daily distribution of cars to every station
according to its needs, and the keeping record of their whereabouts.
And now that the gauges of all roads are similar, and competition
enforces through shipments, roads are practically making common
property of each other's cars, and the detail and trouble of keeping
record of them become enormous.
Interior of a Switch-tower, showing the Operation of Interlocking
Switches.

The records are made up from daily reports, by every conductor,


of every car, home or foreign, handled in his train, and from every
station-agent of all cars in his yard at certain hours. From these
returns the car accountant reports to their respective owners all
movements of foreign cars and gives the transportation department
information where cars are lying. The honesty of each other's
reports concerning car movements is generally relied upon by
railroads, but "lost car agents" are kept travelling to hunt up estrays,
and to watch how the cars of their roads are being handled.
It has been suggested that a great step in advance would be to
have all the roads in the United States unite and put all cars into a
common stock and let them be distributed, record kept of
movements, and mileage paid through a general clearing house.
This would practically form a single rolling-stock company owned by
the roads contributing their cars to it. It could gradually introduce
uniform patterns of construction, improved couplers, and air-brakes,
and could concentrate cars in different sections of the country in
large numbers as different crops required movement, thus avoiding
the blockades which often occur in one section while cars are
superabundant in another. Consolidations usually render more
efficient and cheaper service than separate organizations can do,
and this may come about in the course of time.[18]
We have now seen how the road is maintained and its trains safely
handled. The next step in order is to see how business is secured
and the rates to be charged are fixed. This department may be
controlled by a traffic manager, with two assistants—the general
freight agent and the general passenger agent—or the officers may
report directly to the general manager without the intervention of a
traffic manager. But it would be a more accurate expression to say,
not that these officers "fix" the rates, for if they did few railroads
would ever fail, but that they accept and announce the rates that are
fixed by conditions of competition between different markets and
products, and between different railroads and water lines. Among
these complex forces a railroad freight agent is nearly as powerless
to regulate rates as a professor of grammar is to regulate the
irregularities of English verbs. He can accept them and use them, or
he may let them alone, but the irregularities will remain, all the
same. There is no eccentricity, for example, more idiotic or
indefensible to the ordinary citizen than a habit railroads have of
sometimes charging less money for a long haul than they charge for
a shorter haul. Yet I believe there is not a railroad line in the United
States which will not be found guilty of this apparent folly of
charging "less for the long haul" if its rates to distant points are
followed far enough. For if followed far enough we shall come to the
ocean, and find the railroad accepting business between two
seaports. For instance, all railroads running westward from New York
through some of their connections finally reach San Francisco, and
compete for freight between these ports. But the rates they are able
to obtain are limited by steamers using the ocean for a highway, and
sailing vessels using the wind for motive power, and able to carry
heavy freights at one-tenth the average cost to railroads across
mountains and deserts. This average cost must fix the average rates
charged by the railroads to intermediate points, such as to Ogden, in
Utah. So the railroad must either charge less for the long haul to San
Francisco, or leave that business to be done solely by water. Yet it
may be profitable to the railroad to accept the business at such rates
as it can obtain; for, as in all business ventures, manufacturing or
mercantile, new business can be profitably added at less than the
average cost. And if profitable to the railroad its tendency is
beneficial, even to the intermediate points which pay higher rates, as
promoting better service, besides being advantageous to the whole
Pacific Coast in tending to keep down the rates by water.
But it would lead too far from our subject to follow this and
several other questions which are suggested by it. Only it may be
said briefly that the original Interstate Commerce Bill, introduced by
Mr. Reagan, absolutely prohibited "less for the long haul." The
Senate amended by adding "under similar circumstances and
conditions," and the Interstate Commerce Commission has held that
"water competition" makes dissimilar circumstances and thus
legalizes it.
And in this connection it may be added that the other Senate
amendment to the Reagan bill, creating an Interstate Commerce
Commission, was, next to the above amendment, the wisest
measure of the bill. It forms a body of experts whose opinions and
decisions must gradually educate the public, on the one hand, to a
better understanding of transportation problems, and restrain the
railroads, on the other, from many of the abuses incident to
unchecked competition among them. For, however theorists may
differ as to the advantages or disadvantages of competition in
manufactures and commerce, either absolutely unchecked or
checked only by high or low tariffs, I think all will agree that
unchecked railroad competition is a great evil, because it results in
fluctuating rates and private rebates to large shippers. The rebates,
to be sure, are forbidden by law, but they can be disguised past
recognition. I have known a case, for instance, where a receipt was
given for 75 barrels of whiskey, when only 73 were shipped. The
shipper was to make claim for two barrels lost and be paid an
agreed value as a rebate on his freight bill. In another case, a road
agreed with a certain shipper to pay his telegraph bills for a certain
period in order to control his shipments. Understating the weight or
class of the shipment is another common device for undercharging
or rebating.
In nearly every foreign country there is either a railroad pool or a
division of territory, to prevent this sort of competition, which is only
pernicious. A merchant needs to feel assured that rates are stable
and uniform to all, and not that he must go shopping for secret
rates, in order to be on an equality with his competitor. In the United
States the railroads had largely resorted to pools before the
Interstate Commerce Law forbade them. The result of this
prohibition has generally been very advantageous to the best lines,
which, under the pool, really paid a sort of blackmail to the poorer
lines to maintain rates. If the penalties of the law can restrain such
lines from rebating and under-billing, to be rid of the pool will be a
great blessing to the well-located roads. If not, then the roads will
be driven into consolidation, for the end of fighting will be
bankruptcy and sale. Fortunately consolidation has already gone so
far in many sections of the country that the difficulties of abolishing
rebates have been greatly reduced. And as far as it has gone it has
proved of much advantage both to the public and to the
stockholders.
Fortunately, too, the other results attendant upon consolidation
have been sufficiently demonstrated to remove any intelligent fear of
extortion in rates or deterioration of service. Who would to-day
desire to undo the consolidations which have built up the
Pennsylvania Railroad or the New York Central, and call back to life
the numberless small companies which preceded them? The country
has outgrown such service as they could render, and the local
growth and development along the lines of these consolidated
companies certainly indicates improved conditions. In this
connection, too, the improvement in cost and character of service is
instructive. In 1865 the average rate per ton per mile on the
principal Eastern lines was about 2.900 cents; in 1887 it was 0.718
for a service twice as speedy and efficient.
There are many other live issues of great interest and importance
in transportation suggested by this subject, such as "re-billing" or
"milling in transit," and "differentials," but space forbids more than
an explanation of the meaning of these two especially prominent
ones.

A B C

Let A B and B C be two railroads connecting at B. Let the local


rates A to B be 10 cents per 100 lbs. on grain, and B to C also 10
cents. Let the through rate A to C be 18, since longest hauls are
usually cheapest per mile. Let A be a large grain market, such as
Chicago. Now a merchant at C can save 2 cents per 100 lbs. by
buying direct from A instead of buying from a merchant at B. For the
grain will pay less for the single long haul than for the two short
hauls. But perhaps the town of B has for many years enjoyed the
trade of C, and there are large mills and warehouses erected there.
B will then say it is "discriminated against," and will demand the
privilege of "re-billing" or "milling in transit." That is to say, when a
merchant or miller at B ships to C grain, or flour made of grain,
which he received from A, the two roads consent to make a new
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!

ebooknice.com

You might also like