ptg999
ptg999
800 East 96th Street, Indianapolis, Indiana, 46240 USA
Jennifer Kyrnin
Sams Teach Yourself
24
in
Hours
HTML5
Mobile Application
Development
ptg999
Sams Teach Yourself HTML5 Mobile Application Development in 24 Hours
Copyright © 2012 by Pearson Education, Inc.
All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, or
transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without
written permission from the publisher. No patent liability is assumed with respect to the use of
the information contained herein. Although every precaution has been taken in the preparation of
this book, the publisher and author assume no responsibility for errors or omissions. Nor is any
liability assumed for damages resulting from the use of the information contained herein.
ISBN-13: 978-0-672-33440-5
ISBN-10: 0-672-33440-2
Library of Congress Cataloging-in-Publication Data:
Kyrnin, Jennifer.
Sams teach yourself HTML5 mobile application development in 24 hours / Jennifer Kyrnin.
p. cm.
Includes bibliographical references and index.
ISBN 978-0-672-33440-5 (pbk. : alk. paper)
1. HTML (Document markup language) 2. Mobile computing—Programming. 3. Application
software—Development. I. Title.
QA76.76.H94K97 2012
006.7’4—dc23
2011036380
Printed in the United States of America
First Printing: November 2012
Trademarks
All terms mentioned in this book that are known to be trademarks or service marks have been
appropriately capitalized. Sams Publishing cannot attest to the accuracy of this information. Use
of a term in this book should not be regarded as affecting the validity of any trademark or service
mark.
Warning and Disclaimer
Every effort has been made to make this book as complete and as accurate as possible, but no
warranty or fitness is implied. The information provided is on an “as is” basis. The author and the
publisher shall have neither liability nor responsibility to any person or entity with respect to any
loss or damages arising from the information contained in this book or programs accompanying it.
Bulk Sales
Sams Publishing offers excellent discounts on this book when ordered in quantity for bulk pur-
chases or special sales. For more information, please contact
U.S. Corporate and Government Sales
1-800-382-3419
corpsales@pearsontechgroup.com
For sales outside of the U.S., please contact
International Sales
international@pearson.com
Editor-in-Chief
Mark Taub
Acquisitions Editor
Trina MacDonald
Development
Editor
Michael Thurston
Managing Editor
Kristy Hart
Project Editors
Jovana San
Nicolas-Shirley and
Jess DeGabriele
Copy Editor
Paula Lowell
Senior Indexer
Cheryl Lenser
Proofreader
Leslie Joseph
Technical Editors
Evan Burchard
Pascal Rettig
Publishing
Coordinator
Olivia Basegio
Cover Designer
Gary Adair
Compositor
Nonie Ratcliff
ptg999
Contents at a Glance
Preface ................................................................................. xiv
Part I: Building Web Pages and Applications with the Open Web Standard
HOUR 1 Improving Mobile Web Application Development with HTML5 ........ 1
2 New HTML5 Tags and Attributes with Mobile Development ........... 15
3 Styling Mobile Pages with CSS3 ................................................. 33
4 Detecting Mobile Devices and HTML5 Support............................. 49
5 JavaScript and HTML5 Web Applications .................................... 67
6 Building a Mobile Web Application ........................................... 85
7 Upgrading a Site to HTML5..................................................... 105
8 Converting Web Apps to Mobile .............................................. 119
Part II: Learning the HTML5 Essentials
HOUR 9 Adding Meaning with HTML5 Sectioning and Semantic Elements . 141
10 Drawing with the HTML5 Canvas Element ................................ 163
11 Fonts and Typography in HTML5............................................. 187
12 Audio and Video in HTML5 .................................................... 205
13 HTML5 Forms ....................................................................... 223
14 Editing Content and User Interaction with HTML5 ...................... 245
15 Microformats and Microdata................................................... 261
16 Working with HTML5 Drag-and-Drop Functionality .................... 275
17 HTML5 Links ........................................................................ 293
Part III: HTML5 for Mobile and Web Applications
HOUR 18 Web Application APIs and Datasets.......................................... 309
19 WebSockets, Web Workers, and Files ......................................... 323
20 Offline Web Applications........................................................ 341
21 Web Storage in HTML5........................................................... 355
22 Controlling the Browser History with the History API .................. 373
ptg999
23 Adding Location Detection with Geolocation ............................. 387
24 Converting HTML5 Apps to Native Apps ................................... 405
Appendixes
A Answers to Quizzes ................................................................ 423
B HTML Elements and Attributes ................................................ 437
C HTML5 and Mobile Application Resources................................. 447
Index ............................................................................................449
iv
Sams Teach Yourself HTML5 Mobile Application Development in 24 Hours
- 1
- 2
- 3
- 4
- 5
- 6
前往页