100% found this document useful (12 votes)
144 views

Full download JavaScript for Modern Web Development Building a Web Application Using HTML CSS and Javascript 1st Edition Alok Ranjan Abhilasha Sinha Ranjit Battewad pdf docx

Sinha

Uploaded by

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

Full download JavaScript for Modern Web Development Building a Web Application Using HTML CSS and Javascript 1st Edition Alok Ranjan Abhilasha Sinha Ranjit Battewad pdf docx

Sinha

Uploaded by

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

Get ebook downloads in full at ebookmeta.

com

JavaScript for Modern Web Development Building a


Web Application Using HTML CSS and Javascript 1st
Edition Alok Ranjan Abhilasha Sinha Ranjit
Battewad
https://ebookmeta.com/product/javascript-for-modern-web-
development-building-a-web-application-using-html-css-and-
javascript-1st-edition-alok-ranjan-abhilasha-sinha-ranjit-
battewad/

OR CLICK BUTTON

DOWNLOAD NOW

Explore and download more ebook at https://ebookmeta.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Learning Web Design A Beginner s Guide to HTML CSS


JavaScript and Web Graphics 5th Edition Jennifer Niederst
Robbins
https://ebookmeta.com/product/learning-web-design-a-beginner-s-guide-
to-html-css-javascript-and-web-graphics-5th-edition-jennifer-niederst-
robbins/
ebookmeta.com

Master Web Design with HTML CSS JavaScript and jQuery


Create Stunning Interactive Websites Frahaan Hussain

https://ebookmeta.com/product/master-web-design-with-html-css-
javascript-and-jquery-create-stunning-interactive-websites-frahaan-
hussain/
ebookmeta.com

JavaScript Frameworks for Modern Web Development, 2nd


Edition Sufyan Bin Uzayr

https://ebookmeta.com/product/javascript-frameworks-for-modern-web-
development-2nd-edition-sufyan-bin-uzayr/

ebookmeta.com

Tegan and Sara Modern Heartthrobs Bibliophonic 7 1st


Edition Lau Melody

https://ebookmeta.com/product/tegan-and-sara-modern-heartthrobs-
bibliophonic-7-1st-edition-lau-melody/

ebookmeta.com
Trailer Park Daddy: A Forbidden Romance (Forbidden
Fantasies Book 2) 1st Edition S.E. Law [Law

https://ebookmeta.com/product/trailer-park-daddy-a-forbidden-romance-
forbidden-fantasies-book-2-1st-edition-s-e-law-law/

ebookmeta.com

Organoselenium Chemistry Between Synthesis and


Biochemistry 1st Edition Claudio Santi

https://ebookmeta.com/product/organoselenium-chemistry-between-
synthesis-and-biochemistry-1st-edition-claudio-santi/

ebookmeta.com

Fence Striking Distance Sarah Rees Brennan By Sarah Rees


Brennan Created By C S Pacat Illustrated By Johanna The
Mad
https://ebookmeta.com/product/fence-striking-distance-sarah-rees-
brennan-by-sarah-rees-brennan-created-by-c-s-pacat-illustrated-by-
johanna-the-mad/
ebookmeta.com

Pack Heat Pentalogy 05 0 Playing for Keeps 1st Edition Sam


Hall

https://ebookmeta.com/product/pack-heat-pentalogy-05-0-playing-for-
keeps-1st-edition-sam-hall/

ebookmeta.com

Rethinking Place in South Asian and Islamic Art 1500


Present 1st Edition Deborah S. Hutton (Editor)

https://ebookmeta.com/product/rethinking-place-in-south-asian-and-
islamic-art-1500-present-1st-edition-deborah-s-hutton-editor/

ebookmeta.com
Seducing My Ex Mountain Man Police Officer 1st Edition
Tarin Lex [Lex

https://ebookmeta.com/product/seducing-my-ex-mountain-man-police-
officer-1st-edition-tarin-lex-lex/

ebookmeta.com
JavaScript
for Modern
Web Development

Building a Web Application Using


HTML, CSS, and JavaScript

by
Alok Ranjan
Abhilasha Sinha
Ranjit Battewad
FIRST EDITION 2020
Copyright © BPB Publications, India
ISBN: 978-93-89328-721

All Rights Reserved. No part of this publication may be reproduced or distributed in any form or by
any means or stored in a database or retrieval system, without the prior written permission of the
publisher with the exception to the program listings which may be entered, stored and executed in a
computer system, but they can not be reproduced by the means of publication.

LIMITS OF LIABILITY AND DISCLAIMER OF WARRANTY


The information contained in this book is true to correct and the best of author’s & publisher’s
knowledge. The author has made every effort to ensure the accuracy of these publications, but cannot
be held responsible for any loss or damage arising from any information in this book.
All trademarks referred to in the book are acknowledged as properties of their respective owners.

Distributors:
BPB PUBLICATIONS
20, Ansari Road, Darya Ganj
New Delhi-110002
Ph: 23254990/23254991

MICRO MEDIA
Shop No. 5, Mahendra Chambers,
150 DN Rd. Next to Capital Cinema,
V.T. (C.S.T.) Station, MUMBAI-400 001
Ph: 22078296/22078297

DECCAN AGENCIES
4-3-329, Bank Street,
Hyderabad-500195
Ph: 24756967/24756400

BPB BOOK CENTRE


376 Old Lajpat Rai Market,
Delhi-110006
Ph: 23861747
Published by Manish Jain for BPB Publications, 20 Ansari Road, Darya Ganj, New Delhi-110002
and Printed by him at Repro India Ltd, Mumbai
Dedicated to
Our Parents
who gave us roots to stay grounded and wings to fly high
Late Shri Arun Kumar Thakur and Smt. Nilu Thakur
Shri Ajit Kumar and Smt. Usha Sinha
Shri Narayan Battewad and Late Smt. Suwarna Battewad
About the Authors
Alok Ranjan is a B.Tech in Computer Science and Engineering from IIT
Delhi. After graduating in 2001, Alok worked with companies like Newgen,
Virtusa, and Convergys before starting his entrepreneurial journey. He co-
founded an IT Services Company, Walking Tree, in 2008, which specializes
in cross-platform web/mobile application development, digital
transformation and data-driven decisions. He has been involved in defining
and shaping technology products which have had a meaningful and
measurable impact. When he is not working with customers, he spends time
exploring technologies and building team.
Useful Links:
https://www.linkedin.com/in/alok-ranjan-b36a103/
https://walkingtree.tech/author/wtalok/
https://github.com/wtcalok

Abhilasha Sinha is BE Computer Science from Osmania University. After


completing her graduation in 2003, she started her career as a Software
Engineer with Infosys. She went on to be Senior Technology Architect in a
long and fulfilling association of 12 years. She started as a Java developer,
later moved to Oracle applications and also worked on middleware
technologies like BPEL and OSB. She joined Walking Tree in 2016, where
she continues to explore new technologies and deliver end-to-end custom
web applications for enterprises using the latest technologies and
frameworks like React.js, Angular and Node.js. She is also involved in
training in Modern Web Frameworks like React and Angular. When not
exploring something new, the mother of two boys loves spending time with
her family.
Useful Links:
https://www.linkedin.com/in/abhilasha-sinha-0b795020/
https://skillgaze.com/
https://walkingtree.tech/author/abhilasha-sinha/
Ranjit Battewad has 9+ years of full-stack web and mobile application
development experience. Associated with WalkingTree Technologies from
last 8+ years and playing the role of a senior technical lead, he has exposure
to complex application architecture design and development. His core
expertise areas are Ext JS, Sencha Touch, HTML, CSS, JavaScript, NodeJS,
MongoDB, PostgreSQL, Blockchain - Ethereum, Cordova, ReactJS, Java.
He has proven skills in developing and providing simple solutions for high
complexity applications & development problems. He has a strong
knowledge of databases, such as PostgreSQL and MySQL and is
responsible for the complete life cycle of the project with exceptional
project and team management skills.
Useful Links:
https://www.linkedin.com/in/ranjitbattewad/
https://walkingtree.tech/author/branjit/
https://github.com/ranjit-battewad
About the Reviewers
Suhail Abdul Rehman Chougule, Developed AI/ML Application, Linux,
IBM Power AI Servers, Web Services, Apache Axis2 1.2, SOAP, Django,
MS SQL Server, Ajax, Html, Multithreading,, LDAP (OpenDS), MySQL,
CSS, Object-Oriented JavaScript, jQuery, jQuery UI, SVN, Circle CI (For
Continuous Integration), Bugzilla, SSH. He Leads a team of 14 developers
to develop and launch the AI-based Clinical App called Doctor App. Doctor
App is a Web application and was implemented using MVC architectural
pattern.
Suhail Abdul Rehman Chougule, Designed and implemented UAE based
entities BI (Business Intelligence) dashboard which used Angular JS,
Django, backend MS SQL Server deployed on CISCO Servers. He
Evaluated new technologies. Added jQuery and jQuery UI as new
technologies to be used in different projects. He Implemented a large part of
the UI dynamic functionalities using CSS, jQuery, jQuery UI, Ajax, JSON,
and XML. He Developed back end and front-end parts of Doctor App.
Acknowledgements
First and foremost, we would like to thank the Almighty for giving us the
strength and capability to contribute to the field of knowledge. We would
like to thank everyone at BPB Publications for giving us the opportunity to
publish this book.
We would like to thank our parents and spouse for all the support system, so
we were able to focus on the book, besides our regular work.
Special mention to our children Aayush, Akshar and Vaidik - their energy,
positivity and curiosity, brightens our days and inspires us to keep going
always.
Last but not least, we would like to thank Pradeep, Suman and the entire
team of Walking Tree Technologies for all their timely support.
– Alok Ranjan
– Abhilasha Sinha
– Ranjit Battewad
Preface
In the last few decades, the web and the internet have grown by leaps and
bounds, and it is now nothing short of omnipresent. JavaScript, the soul of
the web and as old as the internet itself, still continues to grow and prosper.
Numerous web and mobile JavaScript frameworks introduced to the world
in the last few years, unleash the potential of JavaScript and make software
application development, a very structured and easy to learn the process.
The primary objective of this book is to create a strong foundation for web
development by covering all aspects of it in one place. Starting from the
basics of HTML, CSS and JavaScript, it brings about the different concepts
of functional and object-oriented programming along with asynchronous
constructs in JavaScript and goes on to introduce one of the popular
JavaScript frameworks of today, React. This book includes step by step
illustration of the development of two simple applications, using all the
knowledge acquired here. This book also covers the supporting areas of the
development process, which includes debugging, testing and deployment.
This book will take you through the entire learning journey from Beginner
to Expert supported with extensive code snippets, best practices, and
concludes with applying the acquired knowledge to build real-life
applications.
This book is divided into 18 chapters, and it will take you through the entire
learning journey of Web application development from Beginner to Expert
supported with code snippets and concludes with applying the acquired
knowledge to build real-life applications.
Chapter 1 starts with the history of web development with Javascript, how
it got started as a feeble companion and turned out to revolutionize the
complete web development and how it continues to evolve and grow
stronger and better.
Chapter 2 summarizes all the important HTML tags and how they can be
used to put together the content for your web page. Starting with the basics,
we will explore the new semantic tags and also different constructs like
lists, links, forms, and images.
Chapter 3 introduces CSS, which will be used to beautify the content in
numerous ways. It explores the power of CSS, understanding the CSS box
model, positioning elements, and making your page responsive.
Chapter 4 discusses the basics of JavaScript, the multifaceted scripting
language of the web, starting from variables to functions and event
handling.
Chapter 5 discusses the functional programming paradigm which focuses
on computing output rather than performing actions, i.e. focus on what to be
done not on how and addresses functional programming using JavaScript
Chapter 6 describes the power of object-oriented programming(OOP),
which enables you to start thinking as working with real-life entities or
objects and understanding OOP in JavaScript.
Chapter 7 describes what is asynchronous flow and how it is achieved in
JavaScript.
Chapter 8 introduces ECMA standards and discovers the new
features(ES2019) and the essential changes of ES2015(ES6) of JavaScript
with examples to put them to use in your applications.
Chapter 9 explains the process of building a full-fledged application from
scratch, putting to use the knowledge of HTML, CSS and JavaScript
acquired so far.
Chapter 10 describes how to debug, how to add logs, how to view the
different DOM elements and track change of values in JavaScript
applications.
Chapter 11 explains the need for Unit Testing and how it can be automated
for web development using JavaScript testing frameworks like Jasmine.
Chapter 12 covers detailed steps to host your static application on the
cloud platform so that your application is accessible over the internet using
a URL.
Chapter 13 covers general JavaScript best practices to follow for any
application development and some very useful tools which help in
enforcing the standards.
Chapter 14 introduces the core concepts of React, a powerful JS library to
build highly performant User Interfaces.
Chapter 15 explains how to approach a new application development using
React and describes by building a real application using ReactJS.
Chapter 16 describes the flow of redux for state management and modify
the React application to incorporate Redux for managing global state.
Chapter 17 explains how to debug, unit test and deploy React applications.
Chapter 18 introduces some additional topics based on various areas
required to be proficient for taking the next leap to become a professional
and building enterprise-level applications.
Downloading the code
bundle and coloured images:
Please follow the link to download the
Code Bundle and the Coloured Images of the book:

https://rebrand.ly/41bbjre
Errata
We take immense pride in our work at BPB Publications and follow best
practices to ensure the accuracy of our content to provide with an indulging
reading experience to our subscribers. Our readers are our mirrors, and we
use their inputs to reflect and improve upon human errors if any, occurred
during the publishing processes involved. To let us maintain the quality and
help us reach out to any readers who might be having difficulties due to any
unforeseen errors, please write to us at :
errata@bpbonline.com
Your support, suggestions and feedbacks are highly appreciated by the BPB
Publications’ Family.
Table of Contents
1. History of JavaScript and How it Revolutionized Web Development
Structure
Objective
A brief history of the World Wide Web
Web transition over the years
Web 1.0
Web 2.0
Web 3.0
Advent of JavaScript
ECMAScript – Standardization of JavaScript
Role of JavaScript in Modern Web development
Front-end JS frameworks
Back-end JS frameworks
Data layer frameworks
JS automation testing frameworks and test runner environments
Conclusion
Questions

2. HTML - Creating the Web Content


Structure
Objective
Getting started with HTML
Building blocks of HTML
Structure of an HTML document
HTML elements
Basic HTML tags to define content
Special content-related tags
HTML hyperlink
HTML list
HTML table
HTML form
Input form element
Other documents randomly have
different content
approaches the table in a pessimistic attitude and the saliva and the
gastric juices are retarded in their flow.
When one is exercising freely, so that the muscular and mucous
coats of the digestive system are strong, the body will handle foods
which, during sedentary habits, it would not digest.
Much indigestion is due to mental apathy. The mind often needs
arousing to an interest in something.
Such an individual needs to know that one of the hardest things for
the members of his family is to live day by day with one who
maintains an attitude of mental depression, and he should stir
himself for “his stomach’s sake,” as well as for the sake of his family,
to a cheerful interest in something. He should let go his grudge and
ride a hobby, if it is a cheerful one, and ride it hard.
It may be well, here, to trace, briefly, the progress of the food
through the digestive tract and the action of the juices and the
ferments on it.[5]

The food in the mouth is mixed with saliva,


which begins the dissolution of the starches. Salivary
Digestion
The saliva consists of about 99.5 per cent. water
and 0.5 per cent. solids. The solids consist of ptyalin, sodium chlorid,
sodium carbonate, mucus, and epithelium. Ptyalin, the most
important of these, is the active digestive agent; the mucus
lubricates the masticated food; the sodium carbonate insures the
alkalinity of the food, and the water dissolves the food that the juices
may more readily reach and act on each particle.
The starches are the only foods whose chemical digestion is
begun in the mouth. They are first broken up by the ptyalin into
dextrin and then into the more simple sugar, known as maltose.[6]
It is important that sufficient saliva be mixed with the food through
mastication, because unless the digestion of the starches is begun
by the saliva, either in the mouth or after it is swallowed, they are not
acted on until they reach the small intestine, consequently their
digestion is unduly delayed. The pancreatic juice must then do more
than its normal work of digestion.
The saliva flows into the mouth, more or less, at all times, but
more copiously during mastication.
The movement of the jaws in chewing incites its flow and when
starches are not well digested, gum chewing, in moderation, though
not a refined habit, is beneficial.
The evident purpose of the saliva when food is not present is to
keep the lining of the mouth moist.
Salivary digestion is carried on in the stomach until the food
becomes thoroughly mixed with the gastric juice, which, being acid,
inhibits the action of the ptyalin.
The thorough and regular cleansing of the teeth is an important aid
to digestion. Food products allowed to remain about the teeth
ferment, rendering the mouth acid. When the mouth is acid, the
alkaline saliva does not secrete in sufficient amount and the mouth is
more or less dry.
The mouth is acid in rheumatism and allied conditions and the
saliva may be thick and ropy so that it does not moisten the food
properly. On the other hand the flow of saliva may be too free, the
ptyalin is then too much diluted to promptly act on the food. This may
result from overstimulation of the salivary glands occasioned by the
excessive chewing of gum, or tobacco. These excesses also carry
too much air into the stomach, resulting in flatulence.
The flow of saliva is controlled, largely, by nerves centering in the
medulla oblongata. The sight of food, pleasingly served, or even the
thought of food which one likes, will increase the flow. This is one
instance of the control of thought over digestion, and the importance
of forming the habit of cultivating a taste for all kinds of food is
apparent. The stronger the relish for the food, and the more
thoroughly it is masticated and mixed with the saliva, the more
perfectly will the first step in digestion be accomplished.
Thorough mastication is important, not only because the chemical
action on the starch molecules is facilitated by the softening and
mixing with the saliva, but also because thorough mastication tends
to prevent overeating—the appetite is more quickly satisfied when
the food is well masticated.
Cool water encourages the flow of saliva and for this reason
should be drunk before meals, particularly when digestion is weak. It
may be taken at rest periods during the meal. (See page 31.)

The relation of the mouth and nasal passages to


The Mouth and the digestive processes is seldom considered by
Nasal Passages the average individual. Their importance to the
growing child is being recognized by the
examination of school children which is now being made a part of the
health program in many of our cities. Their importance to the adult is
no less.
Food particles allowed to remain around the teeth, or in the
cavities of decayed teeth, incite bacterial action. With the next meal
these bacteria are swallowed and cause fermentation of the food,
occasioning indigestion, and possibly, dyspepsia.
Decayed or missing teeth, swollen gums, or pyorrhea, interfere
with proper mastication of food, hence it does not receive the
thorough salivary moistening necessary; the starches pass
practically unchanged into the stomach and small intestine,
overburdening these organs.
Catarrh of the nasal passages, with the constant swallowing of
germ-filled secretions, carries morbid products into the stomach,
coating the glands with mucus, often infecting them; it may also
occasion a catarrhal condition of that organ.
If, from any cause, the saliva becomes acid, dryness of the mouth
results and desire for food is lessened or absent. Diseases of the
salivary glands may render these necessary secretions unfit to
perform their work.
In illness the mouth often drops open from weakness, producing
the same condition of dryness. The mouth, in illness, is too often
neglected by those in charge of the invalid.
Adenoids and enlarged turbinates in child or adult, narrowing the
nasal passages and preventing the ingress of air, cause mouth
breathing. The air dries the membranes and the tongue becomes
swollen and cracks, interfering with proper mastication.
Adenoids should be removed, and any other condition which
interferes with the proper function of the mouth should be remedied
as soon as possible.
The mouth should be properly cleansed, the gums massaged, the
teeth thoroughly brushed, back as well as front, defective teeth
repaired or removed, abnormal growths eliminated, and the
secretions kept abundant and healthy. Food well prepared in the
mouth by thorough mastication satisfies hunger, renders more easy
the work of the stomach and intestines, and aids in the general
welfare of the system.

This too prevalent habit may aggravate the


condition which it is supposed to cure. A slight Gum-chewing
indigestion appearing, gum is often chewed to
cause a fuller flow of saliva to aid digestion. If gum-chewing is
indulged in to excess, however, the muscular movements
overstimulate the salivary glands, eventually weakening them.
Overuse of the chewing muscles and overexcitation of the nerves
fatigue them and cause them to weaken. The sticky gum, adhering
to fillings in the teeth, loosens them and furnishes a lodging place for
food particles and bacteria.
The excess of saliva may render the gastric juice alkaline,
inhibiting its action. Excess of air swallowed with the saliva may
cause flatulence or accumulation of gas in the stomach.
Lack of poise and nerve tension is increased by excessive gum-
chewing, resulting in fatigue of the entire body. This lack of poise
may be noted in any public assembly, as the “movies,” frequented by
gum-chewers.
The habit, as generally practiced, is not an inspiring sight and
should be discouraged.
Gum-chewing in moderation, for a few minutes after a meal, may
not do harm, but its indiscriminate use is to be deplored. Thorough
mastication of food will serve to supply the necessary saliva.
Exercise directed to the stomach and a more thorough circulation
and elimination will do more for any digestive derangement than the
excessive practice of chewing gum.

As the food enters the stomach, the gastric juice


Stomach pours out from the mucous lining, very much as
Digestion the saliva pours into the mouth. Like the saliva, it
consists of 99.5 per cent. water and 0.5 per cent.
solids. The solids of the gastric juice are pepsin, rennin, hydrochloric
acid, and mucus.
The mucus serves to lubricate the food as in the saliva. It perhaps
also aids to prevent the digestion of the mucous lining of the
stomach.
The hydrochloric acid and the pepsin cause the principal chemical
changes in the food while in the stomach. They act only on the
proteins. The hydrochloric acid must be present before the pepsin
can act, as only in an acid medium can pepsin dissolve the proteins.
It is also of an antiseptic nature and hinders or prevents the
decomposition of food.
The rennin ferment precipitates the casein.
The only digestion of starches in the stomach is that continued by
the saliva.
Gastric juice begins to flow into the stomach soon after eating, but
normally it is not secreted in sufficient quantity to supersede salivary
digestion for from twenty to forty-five minutes.
The result of gastric digestion of proteins is their conversion, first,
into albumin, then into proteoses, and, lastly, into peptone, which is
protein in a more simple, soluble, and diffusible form. In the form of
peptone, the proteins are in condition to be absorbed.
If the food has been properly cooked and masticated, gastric
digestion will be completed in from one and one-half to three hours.
If not properly cooked and masticated, the stomach digestion may
continue from one to two hours longer. It should, however, be
completed in three hours.
It will be seen that the evening meal is ordinarily digested before
sleep, as one does not retire for from three to five hours after eating.
If, through imperfect mastication, or a disordered condition of the
stomach, the digestion is not completed in about three hours, the
food is likely to be retained in the stomach and by its weight may
cause prolapsus of that organ if the supporting tissues are weak.
Fermentation may ensue and give rise to gases which may cause
acute distress.
Animal foods, which are readily digested, remain in the stomach
for a shorter time. Meat, as a rule, is easily digested, because the
digestive juices of the animal have converted the starches and
sugars. The white meat of chicken is digested in a shorter time than
the red or the dark meat.
Corn, beets, peas, beans, etc., take about three and a half hours
to digest; baked potatoes about two and a half hours.
Raw vegetables and fruits remain about the same length of time
as potatoes.
Sugar is usually absorbed within an hour.
The cereals, if well cooked, take but two hours.
Coarse or badly masticated food, tough meats, unripe fruits, and
much fat hinder digestion.
Undigested food passing into the intestine may fail to be acted on
there and will sometimes produce diarrhea.
Fluids leave the stomach more rapidly than solids. Seven ounces
of water entirely leaves the stomach in one and one-half hours,
seven ounces of boiled milk in about two hours. Water and buttermilk
almost immediately begin to pass out of the stomach; milk begins to
pass out in about fifteen minutes.
The flow of gastric juice, as the flow of saliva, is governed by the
nerves; the sight, taste, and smell of food, and the attitude of mind
toward it, to a certain extent, regulate its flow.
After the food has accumulated, during the progress of a meal, the
stomach begins a series of wave-like movements called peristaltic
waves.[7] These waves propel the food through the length of the
stomach towards its lower opening, known as the pyloric orifice.
During this process the food is thoroughly mixed with the gastric
juice.
During the early stages of digestion of solids, the sphincter
muscles of the pylorus keep the lower opening of the stomach
closed, but, as digestion progresses, the pylorus gradually relaxes to
let the digested, soluble portion of the food pass into the intestine. If
the food still remains in a solid form, by reason of being improperly
cooked or poorly masticated, as it touches the pylorus, these
sphincter muscles, almost as if they were endowed with reasoning
faculties, close, forcing the undigested mass back to be further acted
on by the gastric juice—the solid mass is not allowed to pass until
dissolved.
If the individual abuses the stomach and causes it to work
overtime, it becomes exhausted and demands rest; it refuses to
discharge the gastric juice in proper proportion; the peristaltic
movements are weak; and food is not promptly or forcefully moved
along the stomach and mixed with the gastric juice. This condition is
termed indigestion.
The food passes from the stomach, through the
pylorus into the small intestine. In this condition of Intestinal
partial digestion it is called chyme. Digestion

The first twelve inches of the small intestine is known as the


duodenum. In the duodenum the food is acted on by the pancreatic
juice, the bile, and the intestinal juices. These juices act on proteins,
fats, and carbohydrates. The bile acts on the fats, while the
pancreatic and intestinal juices act on the proteins and the
carbohydrates. The starches, or dextrin, not fully digested by the
saliva, are changed to maltose and glucose, while the trypsin from
the pancreatic juice, together with the intestinal juices, change into
peptone the protein not fully digested in the stomach. The pancreatic
juice also digests the starch found in raw fruits and in such raw
vegetables as radishes and lettuce.
Fats are almost entirely digested in the small intestine. The
presence of fat stimulates the flow of pancreatic juice, which, in turn,
stimulates the flow of bile. For this reason, in some conditions, if the
liver is sluggish, fatty foods in moderation are desirable. When bile is
not present in sufficient amount the fatty foods ferment and cause
gases and foul odors.
The fats are absorbed almost entirely in the small intestine—
mostly in the duodenum. Some of the fat may be absorbed directly
without undergoing the process of emulsification. Some oils, as
paraffin oil, are not absorbed at all but act only as a lubricant of the
intestines.
When the food enters the intestine its reaction is acid. Mixed with
the bile, pancreatic and intestinal juices, which are alkaline, its
reaction becomes alkaline.
The pancreatic juice splits up the fats into glycerin and fatty acids
and enables the bile to exert its important emulsifying power. The
bile markedly aids this action of the pancreatic juice though it has no
fat-splitting power in itself.
Steapsin, another ferment of the pancreatic juice, acts on both fats
and carbohydrates in either an acid or alkaline medium.
The sodium in the bile unites with the fatty acid, forming a soap
which coats the tiny particles of fat and emulsifies them. The bile
thus aids in the absorption of the fats. It also lubricates the intestinal
mass, facilitating its passage through the entire length of the
intestines. Thus it is a very potent agent in regulating the bowel
movements.
A diminution in the flow of bile quickly expresses itself in
constipation.
Fat and protein stimulate the activity of the liver, while starches, if
taken in excess, incline to overload it.
The food is forced along the intestinal tract by peristaltic or
muscular relaxation and contraction waves, as in the stomach. As it
is so forced, the nutrient elements, after being put into condition for
absorption, are taken up through the villi of the intestinal walls by the
portal veins and the lacteals of the submucous lining.
A larger proportion of food is digested and absorbed than was
formerly supposed, and the excretions from the intestines are, in
many cases, made up almost entirely of refuse, and of the catabolic
waste of the system. In an ordinary mixed diet, it is stated that about
ninety-two per cent. of the proteins, ninety-five per cent. of the fats,
and ninety-seven per cent. of the carbohydrates are retained by the
body.
In digestion, it is of the utmost importance that the muscular,
mucous, and submucous coats, and the secreting glands of the
stomach and intestines be kept thoroughly strong and active, that the
digestive juices may be freely poured out, the nutriment be freely
absorbed, and the food be moved along the digestive tract. The
strength of any organ is gained through the nutriment in the blood;
therefore, daily exercise, which calls the blood freely to these organs
is imperative. Daily exercise should be directed to the vital organs. A
walk for exercise is not sufficient.
The greater part of the food is absorbed through
the intestines, yet some proteins which have been Absorption of
fully digested by the gastric juice, and certain fats, Food
particularly the fats in milk, which are in a natural
state of emulsion, may be absorbed through the walls of the
stomach. However, the absorption through the stomach is small
compared to that through the small intestine.

Diagrammatic
Representation of Villus.
a, 1, cylindrical or “sucking” cells; 2,
goblet cell; 3, capillaries; 4, food
particles ready for absorption by the
cells; b, cylindrical and goblet cells
seen from above.—Adapted from
Landois.

The small intestine is peculiarly fitted for absorption. Its mucous


lining is thrown up into folds to furnish a larger surface for this
purpose. The folds hold the food as it passes toward the large
intestine, until the villi have the opportunity to absorb it.
These transverse folds of the intestinal walls are called valvulæ
conniventes.
The villi are tiny finger-like projections of the mucous lining of the
intestines, which stand out of the lining somewhat as the nap on
plush. They have been called “sucking” villi, because during the
movements of the intestines they seem to suck in the liquid food.
As soon as the foodstuffs—proteins, carbohydrates, and fats—are
put in an absorbable state called chyle, they are very promptly taken
up by the villi.
If for any reason the chyle remains unabsorbed, it is liable to be
attacked by the bacteria always present in the intestines, and gases
form.
The peptones, sugars, and saponified fats are rapidly absorbed,
while the undigested portion, together with the unabsorbed water,
the bile, mucus, and bacterial products, are passed through the
ileocecal valve into the large intestine.
The mass passes up the ascending colon, on the right side of the
abdomen, across the transverse, and down the descending colon,
on the left side, losing, by absorption, the small amount of foodstuffs
not absorbed in the stomach and small intestine. That the large
intestine is to some extent adapted to absorption is shown by clinical
experiments with patients who cannot retain food in the stomach, the
food in such cases being given through rectal injections.
While water and salt are absorbed in both the stomach and small
intestine, the larger part of the water passes into the large intestine,
that it may assist the passage of the intestinal contents.
Water also stimulates peristaltic movements.
As the food is absorbed through the walls of the alimentary canal,
it is picked up by the rootlets of the mesenteric veins and by the
lymph channels—the latter through the abdominal cavity are called
lacteals. Nearly all of the fats are absorbed through the lacteals. The
whitish color given to the contents of the lacteals, by the saponified
fats, gives rise to the term “lacteal.”
Nearly all of the proteins and sugars pass through the mesenteric
veins and the portal veins to the liver. Here the sugars are at once
attacked by the liver cells and built up into glycogen as described on
pages 151 and 159. A small portion of the proteins, however, do not
go to the liver, but are passed directly into the lymphatics and thus
into the blood stream, where they are again carried to the liver, and
the urea is separated.

To sum up, the larger part of the sugars, starches, proteins, and
fats is absorbed through the small intestine, a small amount being
absorbed in the stomach and a very little through the large intestine.
While some water and salts are absorbed in the stomach and small
intestine, these are largely absorbed in the large intestine.

It is economy to keep the digestive organs and


Economy in the circulation and tissues strong, in order that all
Food foods eaten may yield returns, instead of
hampering the activity of the body.
The food which furnishes the most tissue-building substance and
yields the most heat and energy, with the least refuse, is the
economical food, provided it is varied enough to meet the psychical
needs as well as the physical.
Whether or not a food is economical depends on the degree to
which it stimulates the activity of the mind as well as the body.
Preparation and serving here are as important as the material to be
served.
Economy in food is a question into which many factors should
enter. A cheap food is not always an economical food. Amount and
keeping qualities, palatability, ripeness or unripeness, the age, habit,
and occupation of the partakers, all have their share in the problem.
In the selection of food for any individual, the result to be gained
from the food must be borne in mind. If one is doing heavy muscular
work, more protein to rebuild tissue, as well as more carbohydrates
and fats to produce energy, are required than if one’s habits of work
are sedentary.
In mental work, in which the brain is continually active, proteins
are required to resupply the brain tissue, but the fats and
carbohydrates may be lessened. If the brain is sufficiently active to
use all of the fuel in brain energy one does not accumulate fat.
In sedentary occupations, which do not call for hard and
continuous mental activity, the carbohydrates and fats, if taken in
excess, are stored within the system, clogging it and producing
torpid liver, constipation, and obesity.
In a study of tables of food values, in making up a dietary, the
question should be to provide the largest quantity of nutriment at the
lowest cost, with due attention to palatability and variety.
In the selection of meats, for instance, while beef steak may cost
twice as much as beef stew, it must be borne in mind that beefsteak
contains very little waste, and that it contains a large proportion of
albuminoids, or the tissue-building proteins, while, in beef stew, bone
and connective tissue predominate. A large proportion of the
proteins obtained from the beef stew are gelatinoids and extractives
—not the tissue-building albuminoids. (See page 56.)
In comparing the cheaper and the more expensive cuts in the
same kind of beefsteak, however, the cheaper cuts often yield quite
as much nutriment as the more expensive ones. Round steak is just
as nourishing as porterhouse and cheaper, if one considers the
greater number of helpings derived from a pound of round steak than
from a pound of porterhouse.
For the aged or the invalid, however, the question of preparation
will determine the relative economy.
FOOTNOTES:

[5] For a knowledge of the structure and function of the mucous


lining of the stomach and intestines, and of the tributary glands,
such as the liver and pancreas, which is important to a thorough
understanding of digestion, the reader is referred to Let’s Be
Healthy, of this series. In this will be found a study of the
secretion of digestive juices, the conditions favoring normal
secretions, etc.
[6] Hereafter, in speaking of sugar, after it has been absorbed
into the blood, the reader will bear in mind that the term refers not
only to digested sugar, consumed as such, but also to digested
starches (maltose).
[7] See Let’s Be Healthy, by Susanna Cocroft.
CHAPTER VI
ORGANS AND CONDITIONS AFFECTING DIGESTION

T HE purpose of this chapter is to show the work of other than the


digestive organs in assimilation, construction, and elimination.
The liver is commonly called the chemical workshop of the body.
The digested food is carried by the blood (portal veins) to the liver as
soon as it is absorbed from the alimentary canal. As the food
materials filter through the blood capillaries, between the liver cells,
several substances are absorbed, particularly sugar, which is
changed into the animal starch called glycogen. It is held in the liver
for a few hours in this form and is then redigested and gradually
given to the blood in the form of sugar.
While the conversion of the sugar is one prominent function of the
liver, it also acts on the proteins—not as they are first passed
through the liver in the blood, but as they are returned to the liver
from the muscle tissue, partly oxidized and broken up into simpler
products. The liver cells absorb and further oxidize and combine
them into nitrogenous waste, which the kidneys throw off in urea.
The liver and the spleen also dissolve the pigment or coloring
matter out of the red blood corpuscles. As these become useless,
they are broken up in the liver and the spleen. The iron is retained by
the liver cells and the remainder is thrown off in the bile.
The liver is on guard for all poisons which pass through it in the
blood. The large part of these toxic substances are absorbed
through the alimentary canal with the foodstuffs. Many of them are
the result of the fermentation of foods which are not digested so
promptly or so thoroughly as they should be, on account of an
insufficient secretion of digestive juices, or on account of a failure to
secrete them in normal proportions, due to inactivity of the stomach
and intestines.
Nature thus supplies a guard to oxidize, or break down these
poisons and make them harmless, so that normally they do not affect
the nerves and the blood stream, and, through these, the entire
system.
The necessity of correct habits of deep breathing will be readily
seen here, because oxygen is required to break down the poisons as
well as to oxidize the worn-out tissues.
One example of the action of the liver in rendering substances
harmless, is its oxidation of alcohol. From one to three ounces of
alcohol a day may be oxidized and made harmless in the liver,
varying according to the individual and to the condition, at different
times, in the same person. If the limit of one to three ounces is
exceeded, the excess is not oxidized and intoxication results. This is
the reason one may become intoxicated at one time when the same
amount of liquor would not appreciably affect one at another.
The muscles play an important part in the use of foods. Most of
the heat is generated in them by the action of the oxygen in the
blood upon the sugar and fats, liberating their latent heat. This heat
is liberated during every moment of the twenty-four hours whether
one is asleep or awake. Of course, more is liberated during exercise,
since the movement of the muscles sets all tissues into activity and
the blood circulates more strongly, bringing a greater supply of
oxygen to them.
It is always well during active exercise to stop frequently and fully
inflate the lungs, not only to bring more oxygen to the blood, but to
change the residual air and in the inflation to exercise the lung tissue
more freely, bringing a better supply of nourishment to it. We forget
that the lung tissue as well as every other tissue of the body needs
exercise and a full supply of nourishment.
One should form the habit of breathing fully and deeply—
otherwise the liberated carbon dioxid will cause an increased
pressure throughout the blood stream, particularly about the heart
and in the head. This pressure is relieved when the excess of carbon
dioxid has been thrown off by the lungs. Much dull headache is due
to the retention of carbon dioxid resulting from shallow breathing.
Nature makes the effort to throw off this excess of carbon dioxid by
forcing one to breathe more rapidly while running or taking unusual
exercise.
A certain amount of protein is constantly oxidized in muscular
action also, being broken down into carbon dioxid, water, and a
number of nitrogenous mid-products. The carbon dioxid and water
are thrown off by the lungs, and the partially oxidized nitrogenous
waste is carried to the liver, where it is further oxidized and prepared
for excretion through the kidneys, lungs, skin, and intestines.
Through their stimulant action, the nerves aid in oxidizing food
materials. During periods of rest, food materials are also stored in
the nerve cells. During nervous activity they are oxidized and carried
away through the blood and the lymph. This oxidation of the food,
stored in the nerves, creates nervous energy and heat.
The energy liberated by the nerves resembles electrical energy.
When one is continuously using an excess of nerve activity, all
reserve food material, stored in the nerve cells, is used and the
nerves become undernourished. The result is seen in neurasthenic
conditions of various kinds.
The nerves as well as other tissues require protein to renew their
substance as well as fats and carbohydrates for their energy.
The vasomotor nerves influence digestion to a marked extent by
regulating the blood pressure in the digestive organs and the
consequent rate of speed with which digestion and absorption take
place. They speed up or slow down the movements of the alimentary
canal, thus aiding and preventing the admixture of the food with the
digestive juices. By acting on the glands, they aid or prevent the
secretions from being formed and poured out. They thus materially
affect digestion.
The vasomotor nerve centers are in the medulla oblongata.
The lungs absorb oxygen and eliminate carbon dioxid. They
occasionally throw off a very little organic material.
The carbon dioxid is carried to the lungs from the tissues through
the venous stream and diffused through the walls of capillaries in the
lungs. The oxygen is absorbed in the thin air sacs in the capillary
walls.
If the lungs are cramped by a faulty position of the body, by excess
of fat, or by tight clothing, they cannot expand to their fullest extent.
The blood is thus imperfectly aërated and oxygenized and is not
freed of its waste. The lung tissue is imperfectly exercised, sufficient
blood not being brought to the lung cells to insure their strength.
The cramping of the lungs is due largely to incorrect habits of
standing and sitting.
The kidneys do not absorb as do the lungs, neither do they
perform any anabolic work as does the liver, nor catabolic work as
the muscles, nerves, and the liver. They simply throw off waste
matter.
As the blood passes through them urea, uric acid, urates,
sulphates, and sodium phosphates pass from it and with the water
are thrown from the system; hence the kidneys are purifying organs,
as are the lungs. The blood returning from the kidneys through the
veins is pure, just as the blood in the pulmonary vein is pure, while
that in the arteries to the kidneys is impure.
Interference with the action of the kidneys results in an excess of
these substances in the blood and may produce a condition of
intoxication known as uremic poisoning.
The skin, by pressure on the capillaries, controls, to some extent,
their dilatation, and thus prevents an excessive loss of fluid. When a
portion of the skin is removed by accident, as after burns, drops of
moisture may be seen gathering on the denuded surface and may
result in considerable loss if the denuded surface is large.
The skin is a protective covering. We are constantly surrounded
with bacteria, dirt, etc., and the skin prevents their absorption.
It contains glands which secrete a fluid fat. This keeps the skin soft
and flexible, preventing it from becoming too dry. The skin also
prevents the underlying tissues from injury through abrasions or
contact with foreign substances, as in various industries.
It also contains sweat glands, which throw off body waste in the
form of salts and moisture in the perspiration; this helps to regulate
the body heat and to aid in keeping the skin soft.
The kidneys and the skin are interdependent; if the kidneys are
inactive the skin must throw off a larger quantity of waste and if the
skin is inactive, or if for any reason its pores are closed, the kidneys
become more active.
The skin also throws off carbon dioxid and, to a slight extent, it
absorbs oxygen.
Besides digesting and absorbing food, the intestines eliminate
waste.
In their work of elimination, they pass off all undigested matter.
They also carry off bile pigment, bile salts, mucus, other
decomposition products—also a little unabsorbed fat.
Coarse articles of food containing fibers which do not digest, such
as the bran of grains and the coarser fibers of fruits and vegetables
(much of their substances are not food in the strictest sense), are
valuable, as they increase the peristaltic movements of the intestines
and assist in carrying the waste excretions along their course.
The intestines also carry off the organic refuse which is produced
by the chemical action of oxygen. This refuse consists of carbon
dioxid and the nitrogenous waste.
Combustion, or burning of fuel in any form (oxidation to release
latent heat and energy), always leaves a residue, and it is the work
of the intestines to eliminate much of this refuse. When coal is
burned, gas, smoke, ashes, and cinders constitute the waste; if
these were not allowed to escape or were not removed from a stove
the fire would soon go out—the smoke and gas would smother it and
the accumulation of ashes would prevent the circulation of oxygen.
This is true in the body—the carbon dioxid not being allowed to
pass off would soon put out the fires of life; it would poison the body
and inhibit the action of the nerves. If the waste is not thrown from
the system we notice it in a feeling of lassitude, both mental and
physical. If the nitrogenous waste (like ashes and cinders) is not
eliminated, one will die in convulsions in a few days.
The absolute necessity of a free elimination of waste will be readily
seen. If the engine is to do its work, the engineer sees that it is kept
perfectly clean—otherwise it becomes clogged, works inefficiently,
and soon wears out. The same is true in the body—clogging in any
part overworks and wears out other parts dependent on the work of
the defective one.
Constipation, or a failure of the intestines to eliminate the waste is
a grave menace to the system. The poisonous gases accumulating
are absorbed by the system.
The blood carries the digested food and the oxygen to the various
tissues and organs, which select from among the nutrients offered to
them the ones suited to their growth and repair.
It is the universal medium of exchange.
It carries carbon dioxid to the lungs and the wastes of the tissues
to the other eliminative organs.
It carries impure material to the purifying organs, and pure material
away from them.
When it is lacking in quality or quantity the body suffers and if the
lack continues the body dies.
Every organ contributes its share to the work of the blood and
every organ takes from the blood some of its elements. If the blood
pressure is too low, stagnation may occur. If it is too high an
abnormal condition of the system results.
In fact, on the condition of the blood depends the effective working
of the entire organism.
Constant effort then should be intelligently exerted to eat the
proper foods, to exercise judiciously, to think healthful thoughts, to
secure thorough elimination of waste in order that the whole body
shall be fit for the work which its owner desires it to do.

You might also like