This edition first published 2013
2013 Matthew West
Registered office
John Wiley & Sons Ltd, The Atrium, Southern Gate, Chichester, West Sussex, PO19 8SQ, United Kingdom
For details of our global editorial offices, for customer services and for information about how to apply for permission to reuse the copyright material in this book please see our website at www.wiley.com.
The right of the author to be identified as the author of this work has been asserted in accordance with the Copyright, Designs and Patents Act 1988.
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, except as permitted by the UK Copyright, Designs and Patents Act 1988, without the prior permission of the publisher.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books.
Designations used by companies to distinguish their products are often claimed as trademarks. All brand names and product names used in this book are trade names, service marks, trademarks or registered trademarks of their respective owners. The publisher is not associated with any product or vendor mentioned in this book. This publication is designed to provide accurate and authoritative information in regard to the subject matter covered. It is sold on the understanding that the publisher is not engaged in rendering professional services. If professional advice or other expert assistance is required, the services of a competent professional should be sought.
Trademarks: Wiley and the Wiley logo are trademarks or registered trademarks of John Wiley & Sons, Inc. and/ or its affiliates in the United States and/or other countries, and may not be used without written permission. All other trademarks are the property of their respective owners. John Wiley & Sons, Ltd. is not associated with any product or vendor mentioned in the book.
A catalogue record for this book is available from the British Library.
ISBN 978-1-118-35655-5 (paperback); ISBN 978-1-118-43268-6 (ebook); 978-1-118-43270-9 (ebook); 978-1-118-43269-3 (ebook)
Set in Chaparral Pro Light 10/12.5 by Indianapolis Composition Services
Printed in the U.S. at Command Web Missouri
About the Author
Matt West is a developer and entrepreneur who has a keen fascination with exploring new ways that technology can be used to make our lives simpler. Currently residing just outside Northampton, England, Matt fell into web development after getting involved in a number of open-source projects in his spare time.
Matt currently runs Developer City, a small web development agency that specializes in creating innovative web applications for clients all around the world.
Matt writes a blog called Coding Skyscrapers (http://codingskyscrapers.com
) and can be found as @MattAntWest on Twitter.
Publishers Acknowledgements
Some of the people who helped bring this book to market include the following:
Editorial and Production
VP Consumer and Technology Publishing Director: Michelle Leete
Associate DirectorBook Content Management: Martin Tribe
Associate Publisher: Chris Webb
Assistant Editor: Ellie Scott
Development Editor: Sara Shlaer
Copy Editor: Debbye Butler
Technical Editor: Nick Elliott
Editorial Manager: Jodi Jensen
Senior Project Editor: Sara Shlaer
Editorial Assistant: Leslie Saxman
Marketing
Associate Marketing Director: Louise Breinholt
Marketing Manager: Lorna Mein
Senior Marketing Executive: Kate Parrett
Composition Services
Compositor: Indianapolis Composition Services
Proofreader: Wordsmith Editorial
Indexer: BIM Indexing & Proofreading Services
For my father.
Acknowledgments
There may be a single name on the cover of this book, but if the past six months has taught me anything, it is that writing a book is truly a team effort. I am forever grateful for the support and guidance given by so many throughout this process.
To Sara Shlaer, for her solid feedback, patience, and sharp editing skills.
To Nick Elliot, for his incredible eye-for-detail and honest feedback throughout.
To Debbye Butler, for guiding my transition to US English (and correcting the many mistakes that I made along the way.)
To Ellie Scott, for her help in keeping the legal department happy and her general support throughout.
To Chris Webb, for his help in conceiving the direction for this book and for giving me the opportunity to write it in the first place.
To all those at Wiley (and beyond) whom I didnt have the privilege of working with personally, but whom I know worked hard to make this book a reality.
To Ryan Carson, for putting his trust in a stranger and for creating a company that is changing the lives of people all over the world.
To the Treehouse teamparticularly Jim Hoskins, Nick Pettit and Michael Poleyfor providing support whenever it was needed.
To all those within the web industry who share their thoughts, knowledge, and ideas; their inspiration has been invaluable throughout this process.
To my family and friends, for keeping me reasonably sane over the past six months.
Thank you.
Introduction
Sometimes its difficult to remember a time before the World Wide Web. A time before we could find information about anything we desired by simply typing a few words into a search box on our computers, and these days even our mobile phones.
The web has come a long way since its humble origins in the research labs of academics. It has grown to be the single most valuable resource for information that the world has ever known. In doing so, it has created countless billionaires, sparked revolutions within countries throughout the world, and transformed education and science. The United Nations has even proposed that access to the Internet should be a basic human right.
HTML5 is the next step in the history of the web; it is the future. The new technologies introduced by HTML5 enable developers to create websites that are smarter, faster, and more secure than they have ever been before. The best thing about the Internet is that it is an open platform; anyone can build his or her own website. The barriers to entry in this industry are surprisingly lowand thats awesome.
The community surrounding the web industry is the best in the world. Of course, I may be slightly biased, but I really believe that statement is true. I dont know of any other industry where so many people in the community come together to help each other and push the web forward in new and innovative ways. Every day, I wake up and feel privileged to be part of it all. Now it is time for you to join us.
Who Should Read This Book?
This book is for anyone who wants to learn how to create his or her own website and how to use HTML5s exciting new technologies.
The book doesnt assume that you have any experience with programming in HTML, CSS, JavaScript, or any other language for that matter. If you do, thats a bonus, but you will learn everything you need to know to start building awesome websites with HTML5.
This is not a book to help you make the transition from older HTML standards. Everything is covered from the ground up in order to make sure that all the techniques you will learn are up to date. There are plenty of books for experienced developersbooks that go deep into the inner workings of HTML5 technologies and have lengthy explanations on why technologies were developed in a certain way. This book is not one of them. Some parts require a bit of explanation, but for the most part, I wont bore you with the details.