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

Download ebooks file Developing Responsive Web Applications with AJAX and jQuery 1st Edition Sandeep Kumar Patel all chapters

Sandeep

Uploaded by

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

Download ebooks file Developing Responsive Web Applications with AJAX and jQuery 1st Edition Sandeep Kumar Patel all chapters

Sandeep

Uploaded by

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

Visit https://ebookfinal.

com to download the full version and


explore more ebook

Developing Responsive Web Applications with AJAX and


jQuery 1st Edition Sandeep Kumar Patel

_____ Click the link below to download _____


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

Explore and download more ebook at ebookfinal.com


Here are some recommended products that might interest you.
You can download now and explore!

Flask Web Development Developing Web Applications with


Python 1st Edition Miguel Grinberg

https://ebookfinal.com/download/flask-web-development-developing-web-
applications-with-python-1st-edition-miguel-grinberg/

ebookfinal.com

Liquid Crystal Dimers 1st Edition Sandeep Kumar

https://ebookfinal.com/download/liquid-crystal-dimers-1st-edition-
sandeep-kumar/

ebookfinal.com

Developing Web applications with Visual Basic NET and ASP


NET 1st Edition John Alexander

https://ebookfinal.com/download/developing-web-applications-with-
visual-basic-net-and-asp-net-1st-edition-john-alexander/

ebookfinal.com

AJAX and PHP Building Modern Web Applications 2nd Edition


Bogdan Brinzarea-Iamandi

https://ebookfinal.com/download/ajax-and-php-building-modern-web-
applications-2nd-edition-bogdan-brinzarea-iamandi/

ebookfinal.com
AJAX Rich Internet Applications and Web Development for
Programmers 1st Edition Paul J. Deitel

https://ebookfinal.com/download/ajax-rich-internet-applications-and-
web-development-for-programmers-1st-edition-paul-j-deitel/

ebookfinal.com

The Responsive Web 1st Edition Matthew Carver

https://ebookfinal.com/download/the-responsive-web-1st-edition-
matthew-carver/

ebookfinal.com

Beginning jQuery 2 for ASP NET Developers Using jQuery 2


with ASP NET Web Forms and ASP NET MVC 1st Edition Bipin
Joshi (Auth.)
https://ebookfinal.com/download/beginning-jquery-2-for-asp-net-
developers-using-jquery-2-with-asp-net-web-forms-and-asp-net-mvc-1st-
edition-bipin-joshi-auth/
ebookfinal.com

Programming ASP NET MVC 4 Developing Real World Web


Applications with ASP NET MVC 1st Edition Jess Chadwick

https://ebookfinal.com/download/programming-asp-net-mvc-4-developing-
real-world-web-applications-with-asp-net-mvc-1st-edition-jess-
chadwick/
ebookfinal.com

Learning jQuery Better Interaction Design and Web


Development with Simple Javascript Techniques 1st Ed.
Edition Jonathan Chaffer
https://ebookfinal.com/download/learning-jquery-better-interaction-
design-and-web-development-with-simple-javascript-techniques-1st-ed-
edition-jonathan-chaffer/
ebookfinal.com
Developing Responsive Web Applications with AJAX and
jQuery 1st Edition Sandeep Kumar Patel Digital Instant
Download
Author(s): Sandeep Kumar Patel
ISBN(s): 9781783286379, 1783286377
Edition: 1
File Details: PDF, 11.77 MB
Year: 2014
Language: english
www.allitebooks.com
Developing Responsive
Web Applications with
AJAX and jQuery

Design and develop your very own responsive web


applications using Java, jQuery, and AJAX

Sandeep Kumar Patel

BIRMINGHAM - MUMBAI

www.allitebooks.com
Developing Responsive Web Applications with AJAX
and jQuery

Copyright © 2014 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: July 2014

Production reference: 1180714

Published by Packt Publishing Ltd.


Livery Place
35 Livery Street
Birmingham B3 2PB, UK.

ISBN 978-1-78328-637-9

www.packtpub.com

Cover image by Abhishek Pandey ([email protected])

www.allitebooks.com
Credits

Author Project Coordinator


Sandeep Kumar Patel Aaron S. Lazar

Reviewers Proofreaders
Fernando Doglio Simran Bhogal
Md. Zahid Hasan Paul Hindle
Mohammad Amzad Hossain
Indexers
Jake Kronika
Hemangini Bari

Commissioning Editor Rekha Nair


Julian Ursell Priya Subramani

Acquisition Editor Graphics


Mohammad Rizvi Abhinash Sahu

Content Development Editor Production Coordinator


Balaji Naidu Shantanu Zagade

Technical Editors Cover Work


Venu Manthena Shantanu Zagade
Mrunmayee Patil

Copy Editors
Roshni Banerjee
Sarang Chari
Janbal Dharmaraj
Gladson Monteiro
Deepa Nambiar
Karuna Narayanan
Adithi Shetty

www.allitebooks.com
About the Author

Sandeep Kumar Patel is a senior web developer and the founder of


www.tutorialsavvy.com, a widely-read programming blog since 2012. He has
more than 4 years of experience in object-oriented JavaScript and JSON-based web
application development. He is GATE 2005 Information Technology (IT) qualified
and has a Master's degree from VIT University, Vellore. At present, he holds the
position of Web Developer in SAP Labs, India. You can find out more about him
from his LinkedIn profile (http://www.linkedin.com/in/techblogger).
He has received the DZone Most Valuable Blogger (MVB) award for technical
publications related to web technologies. His article can be viewed at
http://www.dzone.com/users/sandeepgiet. He has also received the Java
Code Geek (JCG) badge for a technical article published in JCG. His article can be
viewed at http://www.javacodegeeks.com/author/sandeep-kumar-patel/.

www.allitebooks.com
About the Reviewers

Fernando Doglio has been working as a web developer for the past 10 years.
During that time, he fell in love with the Web and has had the opportunity of
working with most of the leading technologies such as PHP, Ruby on Rails,
MySQL, Node.js, AngularJS, AJAX, REST APIs, and others.

In his spare time, he likes to tinker and learn new things, which is why his
GitHub account keeps getting new repos every month. He's also a big open
source supporter and tries to win the support of new people with the help
of his site: http://www.lookingforpullrequests.com/. He can be contacted
on Twitter at @deleteman123.

When not programming, he can be seen spending time with his family.

Md. Zahid Hasan is a professional web developer. He got his BSc and MSc in
Information and Communication Engineering from University of Rajshahi (RU),
Rajshahi. Now, he is working as a Lecturer in the department of Computer Science
and Engineering at Green University of Bangladesh. He previously worked as a
Software Developer at SEleven IT Limited for 2 years in Bangladesh.

He has a wide range of technical skills, Internet knowledge, and experience across
the spectrum of online development in the service of building and improving online
properties for multiple clients. He enjoys creating site architecture and infrastructure,
backend development using open source tools such as Linux, Apache, MySQL,
and PHP (LAMP), and frontend development with CSS and HTML/XHTML.

www.allitebooks.com
Mohammad Amzad Hossain has 7 years of experience building large-scale
complex websites and web applications. He works as a Branch Manager in Sourcetop
Inc. where he leads an offshore team in Dhaka, Bangladesh. His day-to-day life
requires him to plan, analyze, guide, and provide solutions for complex requirements.
In his free time, he digs into recent trends in web development and follows hundreds
of RSS that help him to keep up in the fast-track world of development. He has a BSc
degree in Computer Science Engineering.

Jake Kronika, a software developer and UI architect with over 20 years of


experience, brings to bear extensive proficiency implementing both server-side and
user interface (UI) solutions including multiple responsive web applications to date.

He began his career early in life using online tools for static content and rapidly
progressed to building dynamic applications incorporating databases and server-side
scripting languages. He has been a Senior User Interface Software Engineer at ADP
Dealer Services in Seattle, WA, USA from 2011. Prior to this, he occupied numerous
senior-level positions in the UI space in Chicago, IL. He has also balanced considerable
freelance work under a sole proprietorship named Gridline Design & Development,
accessible at http://gridlined.com/, online since 1999.

Over the past several years, particularly as the HTML, CSS, and JavaScript portions
of websites have experienced rapid evolution, he has continually sought out and
digested new technological knowledge through reading, personal and client projects,
and other means. Some of his favorite current tools include Node.js and AngularJS,
Less/Sass, and Git VCS.

Prior to this book, he was a technical reviewer for the following Packt
Publishing titles:

• Django JavaScript Integration: AJAX and jQuery, Jonathan Hayward,


in January 2011
• jQuery UI 1.8: The User Interface Library for jQuery, Dan Wellman,
in August 2011
• jQuery Tools UI Library, Alex Libby, in February 2012

www.allitebooks.com
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 [email protected] 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.

TM

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

www.allitebooks.com
www.allitebooks.com
Table of Contents
Preface 1
Chapter 1: Introduction to a Responsive Web Application 7
Benefits of a responsive design 8
Server- versus client-side detection 9
The technology stack 9
HTML5 10
CSS3 and media queries 10
JavaScript 11
Measuring responsiveness 11
Devices and screens 12
Media types 12
Media queries 14
Role of media queries 15
Responsive frameworks 15
Bootstrap 16
The Foundation framework 16
The Cascade framework 16
The Pure CSS framework 17
The Gumby framework 17
Bootstrap 3 for a responsive design 17
What are we building? 18
Summary 19

www.allitebooks.com
Table of Contents

Chapter 2: Creating a Responsive Layout for a Web Application 21


Required software and tools 21
Setting up a Java-based web project 22
Configuring Bootstrap 3 25
Creating a wireframe for a web application 27
Responsive layouts 28
Creating a layout for large and small devices 29
Developing the layout 29
Bootstrap 3 containers 29
Developing a row 31
Developing the menu section 33
Developing the hero section 35
Developing the list of products section 36
The combined layout 41
Verifying the layout 45
The Opera Mobile emulator 45
Summary 52
Chapter 3: Adding Dynamic Visuals to a Web Application 53
Building a JSON servlet 53
Creating a POJO class 53
Creating a product store 55
Converting from POJO to JSON 58
Creating the servlet 58
Building a jQuery AJAX method 62
jQuery promises 64
The jQuery templating mechanism 66
The combined jQuery code 68
The combined HTML markup 69
Modifying the style of the product 71
Building an image carousel 74
Summary 79
Chapter 4: Twitter Integration 81
Introduction to Twitter4J 81
Configuring Twitter4J in a web application 82
Posting a tweet 83
Creating a Twitter button 83
Setting up a new Twitter application 86
The Twitter Permissions tab 88
The Twitter Details tab 89
The Twitter Settings tab 90
The Twitter API Keys tab 90

[ ii ]
Table of Contents

Developing a Twitter servlet 91


Request token 93
Developing a Twitter callback servlet 96
Access token 96
Combining all the pieces 98
Posting a tweet with an image 102
Product store with an image 103
Markup changes 106
Changes in app.js 107
Twitter servlet changes 108
Changes in the Twitter callback servlet 110
User Twitter timeline 111
Summary 111
Chapter 5: Facebook Integration 113
Introduction to the Facebook SDK for JavaScript 113
Creating a Facebook application 115
Configuring the Facebook SDK 117
The Settings tab 118
The Basic configuration 118
The Advanced configuration 119
The Migrations configuration 120
Configuring a Facebook login 120
Configuring the Facebook Like and Share buttons 122
Configuring Facebook comments 127
The combined code 128
Summary 136
Chapter 6: Google+ Integration 137
Introduction to the Google+ API 137
Configuring Google+ 139
Creating a client ID 139
Including the Google script 141
Log in using Google+ 142
Integrating +1 recommendations 144
Summary 149
Chapter 7: Linking Dynamic Content from External Websites 151
Introduction to the YouTube API 151
Configuring a YouTube API 151
Searching for a YouTube video 154
The part parameter 156
The fields parameter 156
The YouTube button markup 156
[ iii ]
Table of Contents

Asynchronous search in YouTube 158


Rendering the YouTube search results 162
Embedding a YouTube video 165
Summary 169
Chapter 8: Integrating E-Commerce or Shopping Applications
with Your Website 171
Creating a shopping cart 171
Adding a product to the cart 171
Displaying the minimal view of the cart 173
Displaying the cart details in a table 174
Configuring the PayPal Developer API 178
Integrating the PayPal Developer API 180
Configuring the Shopify API 191
Integrating the Shopify API 192
Summary 194
Chapter 9: Integrating the Google Currency Converter with
Your Web Application 195
The Google Currency Converter API 195
Configuring the Google Currency Converter API 198
Integrating the Currency Converter API 198
Developing our currency converter 199
Building the currency list dropdown 199
Processing the conversion request 203
Exceptions 208
Summary 208
Chapter 10: Debugging and Testing 209
Implementing the debugging mechanism 210
Dimensions Toolkit 210
The Designmodo Responsive Test tool 210
The Opera Mobile emulator tool 211
The Responsinator tool 211
The Viewport Resizer tool 212
The L-Square Responsive Design Inspector tool 212
The FireBreak add-on 212
The More Display Resolutions 1.0 add-on 213
The BrowserStack Responsive tool 214

[ iv ]
Table of Contents

The MobileTest tool 214


The TestSize tool 215
The Am I Responsive tool 215
The Responsive Design Checker tool 216
The RUIT tool 216
The Responsive Test online tool 217
Testing the app as a whole 217
Summary 219
Index 221

[v]
Preface
Welcome to Developing Responsive Web Applications with AJAX and jQuery. If you
want to learn and understand responsive layout development or social application
integration using AJAX and jQuery, then this book is for you. It covers a systematic
approach for building a responsive web application.

All the key features of a responsive application are explained with the detailed
code. It also explains how to debug and test a responsive web application
during development.

What this book covers


Chapter 1, Introduction to a Responsive Web Application, introduces you to the
responsiveness of an application and lists the key benefits of a responsive
application for a commercial site.

Chapter 2, Creating a Responsive Layout for a Web Application, explains how to develop
a layout that will support different screen sizes to render using Bootstrap 3.

Chapter 3, Adding Dynamic Visuals to a Web Application, explains how to make


a jQuery AJAX call for JSON data and render content in different parts of the
web application.

Chapter 4, Twitter Integration, demonstrates how to integrate the Twitter4J library to


incorporate different features such as tweets and posts from the web application.

Chapter 5, Facebook Integration, demonstrates how to integrate the Facebook SDK to


add the Facebook login and Like features in the web application.

Chapter 6, Google+ Integration, shows how to integrate the Google+ login and +1
feature into the web application.
Preface

Chapter 7, Linking Dynamic Content from External Websites, explains how to integrate
the YouTube API to embed a recommended video into a web application.

Chapter 8, Integrating E-Commerce or Shopping Applications with Your Website, illustrates


the integration of the PayPal payment API into the application. Also, it introduces
the integration of the Shopify API into the application.

Chapter 9, Integrating the Google Currency Converter with Your Web Application,
explains how to integrate the Google Currency API to help a user see the amount
in a different currency.

Chapter 10, Debugging and Testing, introduces the different available online and offline
tools to test a responsive application during development.

What you need for this book


The following list of tools and libraries are required for this book:

• Eclipse IDE for Java EE Developers


• Apache Tomcat 7.0
• Bootstrap 3.0
• jQuery 2.1.0

Who this book is for


This book is for Java web developers who want to create responsive web
applications. This book is also helpful for those who want to learn about the
integration of social applications into existing web applications. Finally, the book
is for everyone interested in better understanding AJAX-based responsive web
application development.

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.

[2]
Preface

Code words in text, database table names, folder names, filenames, file extensions,
pathnames, dummy URLs, user input, and Twitter handles are shown as follows:
"The data-toggle attribute has the value for the effect property such as collapse."

A block of code is set as follows:


<div class="navbar-collapse collapse" id="ts-top-menu">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Category 1</a></li>
<li><a href="#">Category 2</a></li>
<li><a href="#">Category 3</a></li>
</ul>
</div>

When we wish to draw your attention to a particular part of a code block,


the relevant lines or items are set in bold:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="asset/css/bootstrap.min.css">
<title>Responsive product Store</title>
</head>
<body>
<div class="container-fluid"></div>
</body>
</html>

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:
"The Arguments option is for passing additional arguments."

Warnings or important notes appear in a box like this.

Tips and tricks appear like this.

[3]
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 [email protected],


and mention the book title via the subject of your message.

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


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/submit-errata, 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.

[4]
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 [email protected] 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 [email protected] if you are having a problem with
any aspect of the book, and we will do our best to address it.

[5]

www.allitebooks.com
Introduction to a Responsive
Web Application
In this chapter, we be introduced to responsive web design followed by an
understanding of technology stack that made responsive web application
development possible.

The current trend of technology revolution has led us to a point where we can
see many wireless devices with different screen size, resolution, and processing
capabilities. It is really challenging and difficult to create different versions of
web applications for each and every device type. To address this challenge,
it needs a design solution that can address these problems. Responsive web design
provides the platform and flexibility where we can write code once and publish the
application everywhere.

Designing a website to look good at one particular resolution was the standard and
that standard was adequate for almost all purposes. Now, more and more people
are viewing web content on smartphones and tablets. The most successful websites
must have content designed to fit on any size screen or any type of device. Designing
content in this manner is also known as responsive web design. We need to give
all users, regardless of their access platform, a seamless experience, and responsive
web design offers a cost-efficient way of achieving that. Responsive web content can
dynamically change size, fonts, and colors to match whatever device your customers
might be using.
Introduction to a Responsive Web Application

The most important dimensions of a responsive design are as follows:

• An adaptive grid-based layout that must be responsive enough to the


client-side environment. There are two different approaches for an adaptive
layout: the first one is a fixed layout and the other one is a fluid layout.
Fluid layouts are always proportional to the screen size.
• Fluid images must maintain the aspect ratio. To maintain the aspect ratio,
we can go for two approaches, either setting the max-height to 100 percent
or max-width of 100 percent. This makes the images overflow in either
direction. The other way of handling the images is to clip a portion of
the image, though it is not recommended.
• The new CSS3 media queries make the browser more intelligent.
Now, browsers can make the decision to load the appropriate CSS
at runtime. This makes them adaptable to the client environment.

Responsive design is made possible through the use of three core


ingredients: a flexible grid-based layout, flexible images and media,
and CSS media queries.

Benefits of a responsive design


The most important benefits of responsive web application are as follows:

• Pleasant user experience in each type of device


• Reduced development cost compared to developing different applications
for each device type
• Reduced cost on advertising and marketing compared to maintaining
campaigns for every application for each device
• Better indexing in search engines and improved search engine
optimization (SEO)
• Increased conversion rates and lead generation as SEO is increased
(visibility of a web application in search engines)

Responsive web design uses a single code base, but in reality, different devices have
to be accounted for. While a desktop version can display a lot of content at once,
for smaller screens, you need to know exactly what content truly matters. To create
a great experience for all users, you need to consider that people will use different
devices in different circumstances and with different goals. With a responsive web
design, more effort and time will be involved to get the right user experience for
your target audience.

[8]
Chapter 1

If you look into different applications present online such as blogs and sports
applications, then you will notice that the end user behaviors are similar and follow
a common pattern. To provide the same experience for the end users, the layout and
other elements in the application must be designed for customization. This needs
more effort and time in developing the layout and the code.

Server- versus client-side detection


Addressing the issue of developing applications for different media types and
devices can be solved in two ways. The first one is the server-side detection where
middleware is responsible for reading the request header sent by the browser and
redirects the request to the appropriate version of the application. This requires you
to develop a different version of the application. It means an e-commerce site must
have a separate code base for each type of device.

The second one is the client-side detection. It should be done by the browser and
apply relative CSS based on the device or screen type. With this idea, the responsive
design is born. The real benefit is that one has to maintain a single code base for this.

The technology stack


The following diagram shows the building blocks for responsive web application
development. Each block in the diagram represents a technology that enables
responsive web application development.

web Media
application queries

[9]
Introduction to a Responsive Web Application

HTML5
HTML5 is the latest version of HTML, released by the W3C foundation with more
modern features included such as more semantics and usability features. This helps
in responsive web application development with more ease and less effort. Some of
the key points that highlight why HTML5 is a better candidate than other versions of
HTML are as follows:

• Inclusion of new HTML5 elements such as video and audio as native reduces
the use of an additional third-party plugin
• Enhanced existing elements such as form element reduce the need for an
additional amount of code to be written
• Inclusion of Canvas and SVG for graphic rendering and drawing adds
additional capabilities

CSS3 and media queries


Features such as media type detection and layout manipulation of media queries are
useful to build a responsive layout. Some of the key points of CSS3 are as follows:

• CSS3 animations and transitions reduce the need for JavaScript processing,
favoring, instead, a native implementation that can vastly improve
performance on mobile devices where processing power can be quite
limited, while falling back gracefully to immediate changes in browsers
that do not support them.
• Support of new measuring units such as rem helps in building a logical
relationship among elements' dimensions present inside a page.
• Ultimately, the vw and vh units will greatly enhance the ability of a
developer to size elements relative to the viewport.
• FlexBox provides numerous benefits with direction-based alignment and
element ordering inside a layout. For a responsive design, this means that
a default ideal order can be established via the document order to provide
greater SEO benefits, while different ordering can be provided based on
viewport size, device orientation type, and so on, to display content in the
best format for a given use case.

[ 10 ]
Chapter 1

JavaScript
JavaScript brings the capability of feature detection for the browser. It helps in
choosing the right component for the end user and makes the browser responsive
to its environment.

Some of the key points about JavaScript are as follows:

• Browser feature detection helps you to find features that are supported
by the browser. This helps in helps you to execute the appropriate code
in the application.
• Rendering behavior of the site can be altered using JavaScript.

Measuring responsiveness
There are many parameters for measuring the responsiveness of an application.
Layout, content, and navigation are the three most important parameters for a
responsive web application development. The following diagram shows the three
different building blocks of a responsive web application:

•Element positions •Appearance •Page flow

• Layout: While developing a responsive web application for all kinds


of devices, the layout should be developed based on the available size.
Based on the breakpoints for each device size, the layout gets altered.
This includes show and hide of a section in the layout.
• Content: For small screens, the available viewing space is very small.
While developing a responsive web application, the text content must
be responsive. It includes the typography, images, and other media
elements present inside the page.
• Navigation: For touch-enabled devices, the navigational elements will
be different to those on medium devices. How these navigational items
are to be presented to the end user is really a design challenge. It should
be rendered seamless to the end user while navigating in any devices.

[ 11 ]
Introduction to a Responsive Web Application

Devices and screens


If you look at the gadget market for handheld devices, you can find a wide range of
devices with different screen sizes. If you ask me what the optimal size for a device
screen is, I probably could not answer you without knowing the purpose. Each and
every device is good for a specific use. So, the optimal size of a screen is directly
dependent on the end user.

A wide screen with good graphics and pixel density may be the best fit for a gaming
end user. For a regular end user, a small device is a good fit. The web application
design must support all these screen sizes. The usability and the user experience
must be equivalent to all types of screens. Also, it is much more important when it
comes to an e-commerce site. If the end user is browsing the site on a mobile device
and the e-commerce device is only designed for a desktop, then it does not generate
the same pleasant experience that will lose the leads.

The soul of an e-commerce site is lead generation and it is only possible when the
application will provide seamless access to the end user irrespective of the browsing
device. This clearly requires the application to be responsive to its environment or
adapt itself based on the screen or device.

Media types
All these devices (desktops, tablets, mobiles, and laptops) fall in one of the
following media types. The following figure shows all the media types listed
in the W3C specification:

[ 12 ]
Chapter 1

TV

Media
type

TTY

• Braille: This is used for braille tactile feedback devices.


• Embossed: This is used for paged braille printers.
• Handheld: This is used for handheld devices. Smartphones and tablets do
not fall to this.
• Print: This is used for paged material and for documents viewed on screen in
the print preview mode.
• Projection: This is used for projected presentations, for example, projectors.
• Screen: This is used primarily for color computer screens and smartphones.
• Speech: This is used for speech synthesizers.
• TTY: This is used for media using a fixed-pitch character grid. It includes
teletypes, terminals, or portable devices with limited display capabilities.
• TV: This is used for television type devices. It includes low resolution, color,
limited-scrollability screens, and audio.
• Grid: This is used for visual and tactile media types.

Available expressions for media queries to filter the CSS rules are as follows:

• width: This is the width of the current window


• height: This is the height of the current window
• device-width: This is the width of the device

[ 13 ]
Introduction to a Responsive Web Application

• device-height: This is the height of the device


• orientation: This should be either landscape or portrait
• aspect-ratio: This is the aspect ratio of the current window
• device-aspect-ratio: This is the aspect ratio of the device
• color: This is the number of color bits per color component
• color-index: This is the number of available colors on the device
• monochrome: This is the number of bits per pixel in a monochrome
frame buffer
• resolution: This is the resolution of the device
• scan: This should be either progressive or interlace

Media queries
Media queries are one of the best features of CSS3. Using this feature, we can decide
which style sheet should be applied on the web page at runtime.

Media queries can be used as external or internal style sheets. An external style sheet
is easier to organize; it is not downloaded by browsers that don't support it, but it
uses an extra HTTP request. An internal style sheet, on the other hand, does not
require an extra HTTP request, but the whole style sheet is downloaded for browsers
even if they do not support media queries, and it can be harder to organize.

The following code is an example of an external media queries call:


<link rel="stylesheet" type="text/CSS" media="screen and (max-device-
width: 480px) " href="abc.css" />

The following code is an example of internal media queries:


body {
background: gray;
}
@media all and (max-width: 480px){
body{
background: blue;
}
}

[ 14 ]
Chapter 1

Downloading the example code


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.

Role of media queries


CSS3 provides a new set of features called media queries for responsive web
application development. These media queries are helpful for conditional CSS3 used
on a page based on the media type, device width, and other parameters. Generally,
the following parameters help in applying the correct CSS3 to the web page:

• Height and width of the device refers to the size of the device
• Height and width of the browser refers to the viewable area
• Screen resolution refers to the pixel and color depth of the screen
• Orientation of the device refers to the portrait or landscape mode

Using media queries, the layout can be designed in the following two ways:

• The adaptive layout: This is based on a pretty simple idea: instead of using
percentage, we will give our layout fixed sizes. The layout will adapt those
sizes depending of the width of the browser/viewport, thus creating a layout
with different breakpoints.
• The responsive layout: This is a mix between fluid and adaptive layouts.
It will use the relative units of the fluid layout and the breakpoints of the
adaptive one.

Responsive frameworks
There are many frameworks available from different vendors for responsive
web application development. Some of the popular libraries are explored in the
following sections.

[ 15 ]

www.allitebooks.com
Introduction to a Responsive Web Application

Bootstrap
Some of the key points about the Bootstrap framework are as follows:

• Twitter's Bootstrap library is the most popular responsive framework.


• It is based on mobile-first design strategy. The source code of the projects is
available in the SASS and LESS format.
• Bootstrap 3, SASS, and LESS really helps in customizing modules needed for
the project.
• There are many resources and plugins available on the Internet for the
Bootstrap framework.
• You can get more information from http://getbootstrap.com/.

The Foundation framework


Some of the key points about the Foundation framework are as follows:

• Foundation framework is yet another popular responsive framework


by ZURB foundation
• Foundation Version 5 follows mobile-first design strategy (designing your
site or app for the small device first, and then expanding that to include
larger displays and more full-featured devices)
• The major benefit of Foundation framework is that the rem unit is used
for its sizing of fonts and positioning
• You can get more information from http://foundation.zurb.com/

The Cascade framework


Some of the key points about the Cascade framework are as follows:

• The Cascade framework is lightweight and modular.


• The code packages in the Cascade framework are done based on
their features.
• For example, for coloring purpose, there is a color module to be invoked
and used. All features of Cascade framework support Internet Explorer
from IE6 upwards or degrade gracefully.

[ 16 ]
Chapter 1

• The whole library comes under four different modules: grid, typography,
icons, and components. It has also some reusable web page templates in a
different section.
• You can get more information from http://www.cascade-framework.com/.

The Pure CSS framework


Some of the key points about the Pure CSS framework are as follows:

• Pure CSS is a lightweight responsive framework by Yahoo Inc.


• The Pure CSS library is very tiny in size, and is about 4.4 KB minified and
compressed version. This library targets mobile devices.
• The core of this library is Normalize.css. The Normalize library provides
layout and styling of the HTML elements.
• You can get more information from http://purecss.io/.

The Gumby framework


Some of the key points about the Gumby framework are as follows:

• The Gumby framework is incredibly customizable


• It's as easy as download, tweak, and deploy
• Gumby is built on the SASS authoring framework
• Most eye-catching features in Grid modules such as Basic Grid, Hybrid
Grid, Nested Grid, Sematic Grids, Tiles, and Fancy tiles are part of the
Gumby framework
• You can get more information from http://gumbyframework.com/

Bootstrap 3 for a responsive design


There are many components and utilities available for responsive web application
development in Bootstrap. Bootstrap features are available in the following three
different modules:

• CSS: This module has a lot of standard classes to use and is easily extendable
for customization
• Component: This module has all the reusable built-in components
• JavaScript: This module has the jQuery plugin in Bootstrap style

[ 17 ]
Introduction to a Responsive Web Application

Some important features that we are going to use in our web application
development are presented in the following diagram:

Responsive HTML5 Helper JS


Grid layout
utilities elements classes components

• Grid layout: This module has different grid classes for xs, sm, md, and lg
type devices. The details of these grid classes are listed as follows:
°° xs stands for extra small devices. For example, a phone's screen
resolution is less than 768 pixels.
°° xm stands for small devices. For example, a tablet's screen resolution
is greater than or equal to 768 pixels.
°° md stands for medium devices. For example, a desktop's screen
resolution is greater than or equal to 992 pixels.
°° lg stands for large devices. For example, a desktop's screen resolution
is greater than or equal to 1200 pixels.

• Typography: This module has different classes based on the font


size requirements.
• Responsive utilities: This module contains classes for conditional classes
based on the types of devices.
• HTML5 elements: This module has default style classes for all
HTML5 elements.
• Helper classes: This module has classes for frequently used alignment and
positioning issues.
• JS components: This module has additional components such as carousel,
tooltip, popover, and so on.

What are we building?


We are going to use the Bootstrap 3 framework for responsive web application
development. In the following chapters, we will build an e-commerce web
application that will be responsive in design.

[ 18 ]
Chapter 1

The plan is as follows:

• Building the layout for the application


• Populating the content in the layout
• Integrating the application with social media sites
• Integrating a payment system with the Add to Cart feature
• Building a currency converter
• Debugging and testing the web application for responsiveness

Summary
In this chapter, we have learned about the need for a responsive web application
and what challenges it brings to a web developer. We have also learned about the
latest responsive libraries available for development. We have understood how
a responsive layout can increase the user experience. In the following chapter,
we will learn to develop a responsive layout using CSS3.

[ 19 ]
Creating a Responsive
Layout for a
Web Application
In this chapter, we will set up our Java-based web project and develop the layout
required to create our responsive web application. The process of developing the
layout follows a step-wise approach. Initially, we will draw a wireframe for the
layout, and then, we will prepare code for each section using Bootstrap 3 classes.
Later on in this chapter, we will verify the layout with different screen sizes
using some tools.

Required software and tools


We need the following software to be installed to develop the responsive
web application:

• An Eclipse Java EE IDE of Juno/Kepler version for web developers


(http://www.eclipse.org)
• Apache Tomcat 7
• Opera Mobile emulator
• The draw.io online tool
• The Mozilla Firefox browser
• The Google Chrome browser
Creating a Responsive Layout for a Web Application

Setting up a Java-based web project


In this section, we will set up a Java-based web project in Eclipse. To do this, we have
to create a new dynamic web project. The following screenshot shows the window to
create a new web project. In Eclipse, click on the File button and choose New to list
the different project types present in Eclipse.

The different available project types present are shown in the following screenshot.
When this window appears, choose the Dynamic Web Project option.

[ 22 ]
Chapter 2

When you have chosen the Dynamic Web Project option, a New Dynamic
Web Project window will open asking for Project name, as shown in the
following screenshot:

[ 23 ]
Creating a Responsive Layout for a Web Application

For our application, we will name the project MyResponsiveWebApp. The project
structure will look like the following screenshot:

The WebContent folder consists of all the HTML, CSS, and JavaScript files.
The Navigator view of this empty project will look like the following screenshot:

[ 24 ]
Chapter 2

Configuring Bootstrap 3
In this section, we will configure the Bootstrap 3 library in our web project.
Download the Bootstrap 3 library from http://getbootstrap.com/getting-
started/#download. Bootstrap 3 has three different folders in its distribution
package. They are explained as follows:

• js: This folder contains all the scripts required for the Bootstrap 3 library
• fonts: This folder contains all the font-related files including the Glyph icons
• css: This folder contains all the style sheet-related files with Bootstrap's
default theme

The following figure shows the structure of the Bootstrap 3 library:

dist js

[ 25 ]

www.allitebooks.com
Exploring the Variety of Random
Documents with Different Content
I n tE rest
S he C hem
M aT tins.

It appears that this forms an acrostic, and is connected with some


kind of competition in the weekly papers. The two first words have
not been successfully identified, the four last have. All we saw on our
half-sheet was the non-significant termination of the last four words. I
took it to Lees-Jones—you remember Lees-Jones, our Acrostic
expert?—and he said it would have been very difficult to reconstruct
the original acrostic from these indications. Your critical faculty will
not fail to be delighted by the mistake we made in reading “rest” as
“vest,” simply because it came next to the word “socks,” which set up
a train of mental association.
It appears that Davenant used to toy with this peculiar sport, and
Miss Rendall-Smith occasionally helped him. On the Sunday before
the murder she sent him the answer, as far as she could decipher it,
on a full sheet of note-paper, and he tore off half of this when he
wanted to write the cipher message to Brotherhood. The writing was
Miss Rendall-Smith’s own, and I fancy it was purely through that,
with the help of the Post Office, that the police got on her track.
The sleeper-coupon was the most misleading clue of all. It
appears certain that Brotherhood himself did not know of his
impending bankruptcy when he applied for it, and merely intended a
business visit to Glasgow; indeed, he was expected there. The
correction was quite a genuine one, necessitated by an error on the
part of the clerk. And that, I think, finishes the list of enigmas. It was,
of course, Miss Rendall-Smith who sent the other wreath. And it was
Marryatt (I found out by tactful questioning) who took the copy of
Momerie from Reeves’ shelves—he was looking for material for his
evening sermon.
The only problem that remains to me is this—Do we really know in
full the part which Miss Rendall-Smith plays in the story? Davenant’s
excessive anxiety to keep her out of the whole business looks to me,
I confess, suspicious. But I know how you distrust theories; and
perhaps since Davenant was content to die in silence it would be
ungenerous to probe further. The police, certainly, have made no
attempt to do so. Reeves has never called on Miss R.-S., or heard
from her.
Reeves himself, meanwhile, is entirely changed for the better. He
has forsworn detective work, and succeeded in doing the ninth in
four. The other day I actually heard him start a sentence with the
words “When I was a limpet in the War Office,” so I think there is
hope for him yet. I call him “Mordaunt Reeves, the Converted
Detective.”
I hope you will excuse my typewriting this letter; its inordinate
length must be my apology. I hope we shall see you here again
before long, and have less stirring times together. My wife wishes to
be remembered to you very kindly; her rheumatism has almost
disappeared.
Yours sincerely,
William Carmichael
Endnote
¹ To the Reader—This chapter may be omitted if the book be thought too long. ↩︎
Transcriber’s Notes
This transcription follows the text of the edition published by Simon
and Schuster, Inc. in 1926. The following alterations have been
made to correct what are believed to be unambiguous errors in the
text:

“circumstancs” has been changed to “circumstance” (Chapter


VII);
“Reeve’s” has been changed to “Reeves’ ” (Chapter XII);
“they’d thing it was” has been changed to “they’d think it was”
(Chapter XVI);
“Marrayyatt’s” has been changed to “Marrayatt’s” (Chapter XXI);
“Oatville” has been changed to “Oatvile” (Chapter XXIII);
*** END OF THE PROJECT GUTENBERG EBOOK THE VIADUCT
MURDER ***

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

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


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

START: FULL LICENSE


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

To protect the Project Gutenberg™ mission of promoting the free


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

Section 1. General Terms of Use and


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

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


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

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

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

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


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

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


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

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


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

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


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

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


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

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


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

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


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

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

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


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

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


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

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

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


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

1.F.

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


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

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


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

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


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

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

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


warranties or the exclusion or limitation of certain types of damages.
If any disclaimer or limitation set forth in this agreement violates the
law of the state applicable to this agreement, the agreement shall be
interpreted to make the maximum disclaimer or limitation permitted
by the applicable state law. The invalidity or unenforceability of any
provision of this agreement shall not void the remaining provisions.
1.F.6. INDEMNITY - You agree to indemnify and hold the
Foundation, the trademark owner, any agent or employee of the
Foundation, anyone providing copies of Project Gutenberg™
electronic works in accordance with this agreement, and any
volunteers associated with the production, promotion and distribution
of Project Gutenberg™ electronic works, harmless from all liability,
costs and expenses, including legal fees, that arise directly or
indirectly from any of the following which you do or cause to occur:
(a) distribution of this or any Project Gutenberg™ work, (b)
alteration, modification, or additions or deletions to any Project
Gutenberg™ work, and (c) any Defect you cause.

Section 2. Information about the Mission of


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

Volunteers and financial support to provide volunteers with the


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

Section 3. Information about the Project


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

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


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

Section 4. Information about Donations to


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

The Foundation is committed to complying with the laws regulating


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

While we cannot and do not solicit contributions from states where


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

International donations are gratefully accepted, but we cannot make


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

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

Section 5. General Information About Project


Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could be
freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose network of
volunteer support.

Project Gutenberg™ eBooks are often created from several printed


editions, all of which are confirmed as not protected by copyright in
the U.S. unless a copyright notice is included. Thus, we do not
necessarily keep eBooks in compliance with any particular paper
edition.

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

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg Literary
Archive Foundation, how to help produce our new eBooks, and how
to subscribe to our email newsletter to hear about new eBooks.
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!

ebookfinal.com

You might also like