Beginning iPhone and iPad Web Apps Scripting with HTML5 CSS3 and JavaScript 1st Edition Chris Apers - The ebook with rich content is ready for you to download
Beginning iPhone and iPad Web Apps Scripting with HTML5 CSS3 and JavaScript 1st Edition Chris Apers - The ebook with rich content is ready for you to download
com
https://ebookname.com/product/beginning-iphone-and-ipad-web-
apps-scripting-with-html5-css3-and-javascript-1st-edition-
chris-apers/
OR CLICK HERE
DOWLOAD EBOOK
https://ebookname.com/product/learn-html5-and-javascript-for-ios-
web-standards-based-apps-for-iphone-ipad-and-ipod-touch-1st-
edition-scott-preston/
https://ebookname.com/product/metro-revealed-building-
windows-8-apps-with-html5-and-javascript-1st-edition-adam-
freeman/
https://ebookname.com/product/client-server-web-apps-with-
javascript-and-java-1st-edition-casimir-saternos/
https://ebookname.com/product/the-complete-book-of-woodworking-
an-illustrated-guide-to-tools-and-techniques-declan-odonoghue/
Understanding Clinical Papers 2nd Edition David Bowers
https://ebookname.com/product/understanding-clinical-papers-2nd-
edition-david-bowers/
https://ebookname.com/product/world-film-locations-glasgow-1st-
edition-nicola-balkind/
https://ebookname.com/product/irrigation-and-water-power-
engineering-16th-edition-punmia/
https://ebookname.com/product/rethinking-risk-assessment-the-
macarthur-study-of-mental-disorder-and-violence-1st-edition-john-
monahan/
https://ebookname.com/product/out-in-africa-lgbt-organizing-in-
namibia-and-south-africa-social-movements-protest-and-
contention-1st-edition-ashley-currier/
Tradition Book Cult of Ecstasy Mage The Ascension Lynn
Davis
https://ebookname.com/product/tradition-book-cult-of-ecstasy-
mage-the-ascension-lynn-davis/
Beginning iPhone and iPad Web Apps: Scripting with HTML5, CSS3, and JavaScript
Copyright © 2010 by Chris Apers and Daniel Paterson
All rights reserved. No part of this work may be reproduced or transmitted in any form or by
any means, electronic or mechanical, including photocopying, recording, or by any
information storage or retrieval system, without the prior written permission of the
copyright owner and the publisher.
ISBN-13 (pbk): 978-1-4302-3045-8
ISBN-13 (electronic): 978-1-4302-3046-5
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
Trademarked names, logos, and images may appear in this book. Rather than use a
trademark symbol with every occurrence of a trademarked name, logo, or image we use the
names, logos, and images only in an editorial fashion and to the benefit of the trademark
owner, with no intention of infringement of the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms,
even if they are not identified as such, is not to be taken as an expression of opinion as to
whether or not they are subject to proprietary rights.
President and Publisher: Paul Manning
Lead Editor: Steve Anglin
Technical Reviewer: Paul Haine
Editorial Board: Steve Anglin, Mark Beckner, Ewan Buckingham, Gary Cornell, Jonathan
Gennick, Jonathan Hassell, Michelle Lowman, Matthew Moodie, Duncan Parkes,
Jeffrey Pepper, Frank Pohlmann, Douglas Pundick, Ben Renow-Clarke, Dominic
Shakeshaft, Matt Wade, Tom Welsh
Coordinating Editor: Adam Heath
Copy Editor: Kim Wimpsett
Compositor: MacPS, LLC
Indexer: BIM Indexing & Proofreading Services
Cover Designer: Anna Ishchenko
Distributed to the book trade worldwide by Springer Science+Business Media, LLC., 233
Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505,
e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com.
For information on translations, please e-mail rights@apress.com, or visit www.apress.com.
Apress and friends of ED books may be purchased in bulk for academic, corporate, or
promotional use. eBook versions and licenses are also available for most titles. For more
information, reference our Special Bulk Sales–eBook Licensing web page at www.apress.com/
info/bulksales.
The information in this book is distributed on an “as is” basis, without warranty. Although
every precaution has been taken in the preparation of this work, neither the author(s) nor
Apress shall have any liability to any person or entity with respect to any loss or damage
caused or alleged to be caused directly or indirectly by the information contained in this
work.
The source code for this book is available to readers at www.apress.com.
Contents at a Glance
■Contents .......................................................................................................... v
■About the Authors ..........................................................................................xv
■About the Technical Reviewer.......................................................................xvi
■Acknowledgments........................................................................................xvii
■Introduction.................................................................................................xviii
Part I: Getting Started with Web App Development ............................................ 1
■Chapter 1: Development Tools......................................................................... 3
■Chapter 2: Development Environment ........................................................... 13
■Chapter 3: Introducing Developer and Debugging Tools ............................... 29
Part II: Web App Design with HTML5 and CSS3 ................................................ 65
■Chapter 4: The Anatomy of a Web Application .............................................. 67
■Chapter 5: User Experience and Interface Guidelines ................................... 89
■Chapter 6: Interesting CSS Features for Your Web Application
User Interface ............................................................................ 117
■Chapter 7: Bitmap and Vector Graphics and Downloadable Fonts
with Canvas and SVG................................................................. 165
■Chapter 8: Embedding Audio and Video Content in
Your Web Application ................................................................ 219
■Chapter 9: Handling Transformations, Animations,
and Special Effects with CSS ..................................................... 257
Part III: Going Futher with JavaScript and Web Standards ............................ 299
■Chapter 10: An Object-Oriented JavaScript Programming Primer.............. 301
■Chapter 11: Cross-Document Communication ............................................ 321
■Chapter 12: Ajax and Dynamic Content ....................................................... 343
■Chapter 13: Using Touch and Gesture Events.............................................. 367
■Chapter 14: Location-Aware Web Applications ........................................... 397
■Chapter 15: A Better Handling of Client-Side Data Storage......................... 431
■Index............................................................................................................ 467
iv
Contents
■Contents at a Glance....................................................................................... iv
■About the Authors ..........................................................................................xv
■About the Technical Reviewer.......................................................................xvi
■Acknowledgments........................................................................................xvii
■Introduction.................................................................................................xviii
v
■ CONTENTS
vi
■ CONTENTS
vii
■ CONTENTS
viii
■ CONTENTS
x
■ CONTENTS
xi
■ CONTENTS
xii
■ CONTENTS
Summary ............................................................................................................................................................395
■Chapter 14: Location-Aware Web Applications ........................................... 397
The Geolocation API ............................................................................................................................................398
Privacy Considerations ..................................................................................................................................398
Setup Considerations.....................................................................................................................................398
Getting the Current Position................................................................................................................................399
Longitude, Latitude, and More .......................................................................................................................399
Handling Errors from Requests......................................................................................................................401
Accuracy, Timeout, and Cached Location......................................................................................................402
Putting the User on a Map with Google Maps.....................................................................................................403
Showing the Map...........................................................................................................................................403
Centering the Map on the Location of the User .............................................................................................405
Marking the Position of the User ...................................................................................................................407
Showing Accuracy .........................................................................................................................................409
Tracking the User’s Position ...............................................................................................................................410
Registering for Updates .................................................................................................................................410
Specific Behavior of the Watcher...................................................................................................................411
Watching Position on Google Maps................................................................................................................412
From Data to Math ..............................................................................................................................................413
Distance Between Two Points .......................................................................................................................413
Sharper Distance Between Two Points..........................................................................................................414
The Direction to Take.....................................................................................................................................415
Building a Compass Web App .............................................................................................................................416
Create the Mobile Elements...........................................................................................................................416
The Graduations.............................................................................................................................................418
The Needles ...................................................................................................................................................420
The Dial Shine................................................................................................................................................421
Render the Compass......................................................................................................................................422
Add Elements to the Document .....................................................................................................................424
Prepare the Document to Receive Location Data ..........................................................................................425
Use Location Data ..........................................................................................................................................426
Animate the Compass....................................................................................................................................427
Prevent Staggering Needles ..........................................................................................................................429
Summary ............................................................................................................................................................430
■Chapter 15: A Better Handling of Client-Side Data Storage......................... 431
Different Storage Areas ......................................................................................................................................431
How to Use New Storage Capabilities............................................................................................................432
Specific Behavior of sessionStorage .............................................................................................................433
Being Notified of Storage Area Modification..................................................................................................434
Security and Privacy Considerations .............................................................................................................435
Caching Ajax Requests ..................................................................................................................................435
Sending Client Data to the Server..................................................................................................................441
SQL Local Database ............................................................................................................................................442
Opening the Database....................................................................................................................................443
Creating Tables..............................................................................................................................................444
Adding Data to Tables....................................................................................................................................446
Querying Data from the Tables ......................................................................................................................448
xiii
■ CONTENTS
xiv
About the Authors
Chris Apers has more than 13 years experience in web technologies and
mobile development, including the PalmOS, webOS, and iPhone. He is a
technical manager and architect at Newsweb/Lagardère Active and
participates in open source projects such as porting development libraries
and software to mobile devices. With the creation of the open source
framework WebApp.Net, he provides an easy way to create mobile content
targeting WebKit browsers. For more, visit www.webapp-net.com and
www.chrilith.com.
Daniel Paterson has a master’s degree in comparative literature, and he penned a memoir on
integrating literary theory into fictional works, taking novels by Umberto Eco, Milan Kundera,
and David Lodge as examples. After his university years, Daniel entered web development and
joined Newsweb/Lagardère Active in April 2009. Passionate about the Web as about many other
things, he enjoys every opportunity to work on interesting projects and to develop his skills.
xv
Other documents randomly have
different content
En otro tiempo, sin duda por la proximidad al primitivismo de Rousseau,
presumían los vascos de ser un pueblo nuevo, un pueblo joven, que
modernamente comenzaba a vivir. Hoy no podemos recostarnos en esa
teoría de la juventud. Todo indica, al revés, que los vascos deben inscribirse
entre los pueblos que han vivido mucho.
DIFERENCIACIONES Y PARECIDOS
V. de Zubiaurre, pint.
N INGÚN trozo geográfico o antropológico del mundo se halla bastante
aislado para que pueda suponérsele único, virgen de todo contacto y
libre de comunicaciones reales. El territorio vasco, por su pequeñez y
por la posición que ocupa precisamente en el gran camino de las
migraciones, no es el que más se ha librado de las influencias externas. Nos
atreveríamos a decir que los vascos, semejantes en esto a los ingleses,
admitieron siempre todo lo que llegaba del exterior. Por tanto, en el
contenido del país hay mucho de mosaico, cuyas piezas múltiples es fácil
hoy mismo separar con un mediano espíritu de observación. En el país
vasco han ido posándose los residuos de las civilizaciones circulantes, sobre
todo y casi exclusivamente las civilizaciones hispano-castellanas. En el
propio idioma éuscaro se descubren numerosos vocablos de origen
medioeval, y hasta del tiempo oscuro en que el bajo latín se convertía en
rudo romance castellano. No es necesario resaltar ahora cómo la legislación
foral hispano-castellana va dejando en las leyes vascongadas sus distintos y
sucesivos aspectos. En cuanto a la arquitectura, el país vasco acoge las
formas que llegan de la meseta central, hasta las formas de origen
mahometano; en Azpeitia y Azcoitia, efectivamente, se ven casas abolengas
donde el ladrillo está trabajado según la manera mudéjar.
Las agrupaciones humanas son como círculos concéntricos, que varían
por su dimensión y jerarquía, pero no por sus caracteres específicos. Una
simple aldea reúne ya todo lo esencial de una gran nación: atomismo, celos
de barrio, luchas de castas, diferencias de terreno y de clima. Una región es
un círculo también, semejante a un círculo nacional del tipo moderno.
Si observamos, pues, la región vascongada la veremos dividida, lo
mismo que un gran Estado, en partes desiguales y aun antagónicas.
Geográficamente tiene zonas cálidas, mediterráneas, esteparias, meseteñas,
de llanura; otras son húmedas, cantábricas, tibias y de valles estrechos; otras
son de alta montaña, frías y boscosas.
La flora recorre toda la gama mediterráneo-alpina, desde los castaños y
helechos de los climas brumosos, hasta el tomillo de las tierras esteparias y
los olivares de los llanos calientes.
El tono de la raza, ¡qué distinto aparece también! Hacia el lado
cantábrico, la gente presenta una piel más blanca y rosa; hacia el lado
opuesto, en la vertiente del Mediterráneo, la piel se quema y tiende a ser
cobriza o amarilla. Los del lado del mar son hombres de aspecto físico más
voluminoso, de cuerpos grandes que propenden a la obesidad; los del otro
lado de la divisoria son más pequeños, enjutos, violentos y vivaces.
El tipo del cráneo varía igualmente, aunque pueda señalarse una forma
general, como la más frecuente: la forma dolicocefálica, común a casi todos
los pueblos meridionales. No es tan uniforme el color del pelo y de los ojos.
Mientras unos vascos se significan por el tono oscuro del cabello y ojos,
otros se nos presentan francamente rubios y de ojos muy claros. Los ojos de
color intermedio abundan notablemente, tal vez tanto como en Italia; hay
pocos ojos de matiz germano puro, como en Francia, pero son incontables
los matices ambiguos: azulados grises, azulados verdosos, grises verdosos.
Añadiremos todavía que a lo largo de la región es fácil descubrir zonas
más o menos importantes en donde prepondera el color claro de los ojos y
el pelo. Parecen manchas antropológicas caídas allí al azar, pero que
obedecen a causas o inmigraciones prehistóricas. En la parte pirenaica de
Navarra abundan mucho estas zonas o manchas de color claro; en los valles
elevados, y en la misma cuenca de Pamplona, se ven con sorpresa cráneos
redondeados y cabellos rubios, que recuerdan bastante a los del mediodía de
Francia del tipo gascón y bearnés.
Contra lo que parecería natural, el tipo de ojos y pelo moreno abunda
mucho más en la vertiente cantábrica. Por un efecto de ilusión, mirando
sólo al matiz general de las personas, suele creerse que el vasco del lado del
Cantábrico es un hombre blanco, claro, casi rubio en oposición al hombre
de la meseta.
Lo cierto es, sin embargo, que en la meseta central española no abundan
los tipos puramente morenos tanto como en Marquina o Andoaín. En el
centro de España se da con más frecuencia el tipo castaño; para encontrar
ojos y cabellos francamente morenos es preciso retirarse a las costas, sean
de Cataluña, de Murcia, de Andalucía o del Cantábrico. La ilusión de
«morenez» del centro de España tiene su origen en el cutis seco, tostado y
amarillento, producto nada más que del clima; tan pronto como el centro de
España deja de ser meseta y desciende de nivel, como ocurre en
Extremadura, pierde la piel ese matiz uniforme y seco y cobra color vivo.
Aunque los ríos del país vascongado, como todos los de la región
cantábrica, sean tan minúsculos que apenas merecen más que el nombre de
arroyos, tienen, sin embargo, una positiva fuerza de diferenciación
etnográfica.
Los ríos son pequeños, es verdad, pero ni en ellos mismos fracasa esa ley
de Geografía que hace de las cuencas hidrográficas las más naturales y
primarias expresiones regionales. En efecto, y refiriéndonos a un río
famoso, todos saben que las gentes que pueblan las riberas del Ebro, desde
Miranda a Tortosa, tienen puntos psicológicos y temperamentos comunes,
de modo que un riojano, un navarro ribereño y un aragonés coinciden en las
costumbres, en los cantos; en el tono del lenguaje y en los sentimientos.
Así también ha herido siempre mi curiosidad esa extraña filiación que se
observa en los habitantes de los distintos ríos vascongados. Para conocer las
diferenciaciones de lenguaje, de costumbre y hasta de matices raciales en el
país vasco, necesariamente y casi exclusivamente debemos recurrir a la
hidrografía. Las cuencas hidrográficas son de veras las que unen a los
hombres y los diferencian de sus vecinos.
Refiriéndome a la provincia de Guipúzcoa, que es la que más conozco,
diré que las tres grandes separaciones dialectales y costumbristas de esa
provincia se sujetan a las tres cuencas hidrográficas importantes: el río
Deva, el Oria y el Bidasoa. Los otros ríos, de curso más insignificante,
como el Urola, el Urumea y el Oyarzun, aunque positivamente tienen fuerza
diferenciadora, ésta no es tan notable como la de los otros ríos; sus matices
diferenciadores son de índole muy sutil y no vale la pena de anotarlos.
El tono de la voz y el dialecto que hablan las gentes de Irún y
Fuenterrabía, son mucho más semejantes a los de Hendaya, Vera y Echalar,
que a los de Villabona, Tolosa y Beasaín. En cuanto al dialecto y las formas
costumbristas de las gentes del Deva, se separan bastante
considerablemente de las del río Oria. Esta diferencia de dialecto, usos y
hasta tipo de raza entre las gentes del Oria y del Deva es tan notable, que
parecen dos provincias diversas.
Desde Oñate y Mondragón, hasta Mendaro y Deva, el idioma adquiere
rasgos vizcaínos, como son, principalmente, las terminaciones en «u» y el
uso de la jota con sonido suave, como la «ch» francesa. Veremos también
que en la cuenca del Deva tienen las villas un aire más señorial, y que su
arquitectura, más aristocrática que la del Oria, es por tanto más fina y
elegante; las casas fuertes de Oñate y Vergara, por ejemplo, indican con
facilidad que en esta parte de la provincia existió mayor preocupación
hidalguesca, y que fueron aquí los señores banderizos mucho más soberbios
e influyentes que en la región del Oria. En fin, la raza se diferencia también;
un espíritu medianamente sagaz comprende pronto que la gente de Eibar y
Vergara es de tipo más moreno, acaso más fino y «decadente», menos
vigoroso, más aguileño, que los ejemplares de Asteasu, Amezqueta y
Tolosa.
Para mí, la verdadera Guipúzcoa se halla enclavada en la región
hidrográfica del Oria, la cual se extiende a un lado y otro abarcando en
cierta manera la cuenca del Urola, del Urumea y el país semillano que va
hacia el bajo Bidasoa. La cuenca del Deva es una provincia aparte que
abraza las comarcas afines de Marquina, Ermúa y Elorrio, hasta el llano de
Durango.
Después señalaremos la diferencia bien honda entre la gente pescadora y
la labriega, entre «costarras» y «goyerritarras». Y ensanchando el espacio
de las comparaciones, encontraremos que, en términos generales y en
mayores síntesis, Guipúzcoa es más suave y atemperada que Vizcaya;
Vizcaya es más dura, más terca e irascible, y se parece al tono genérico
español; Álava, prescindiendo de los apéndices de Ayala y Aramayona,
tiene el aire modesto, el aire de llanura como «virtuosa» y económica, de la
tierra de Burgos.
En Navarra hay porciones guipuzcoanas; otras, como el Baztán,
recuerdan al país vasco-francés; otras zonas son alto-pirenaicas, y otras, por
fin, tienen el tono impulsivo y cálido de la Rioja y de Aragón.
La provincia de Vizcaya, a causa de cierta arbitrariedad de sus ríos, es
casi tan heterogénea y está diferenciada como Navarra. Esa cuenca del
Nervión es un verdadero remolino de procedencias dispares; el vascuence y
el castellano se encuentran y unen allí; afluyen las influencias del alto
Ibaizábal, se unen a las de Orozco, llegan las de Álava, y reciben por último
las del Cadagua. Esto explica que la zona propiamente bilbaína, desde
Achuri a Portugalete, sea lo más violento, turbio y heterogéneo del país
vasco y de la propia región cantábrica.
XXII
IDEAS FINALES
V. de Zubiaurre, pint.
Updated editions will replace the previous one—the old editions will
be renamed.
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.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.
• 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 comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
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.
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.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.
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.
ebookname.com