Head First HTML5 Programming

Head First HTML5 Programming

HTML has been on a wild ride. Sure, HTML started as a mere markup language, but more recently HTML's put on some major muscle. Now we've got a language tuned for building web applications with Web storage, 2D drawing, offline support, sockets and threads, and more. And to speak this language you've got to go beyond HTML5 markup and into the world of the DOM, events, and JavaScript APIs.

Now you probably already know all about HTML markup (otherwise known as structure) and you know all about CSS style (presentation), but what you've been missing is JavaScript (behavior). If all you know about are structure and presentation, you can create some great looking pages, but they're still just pages. When you add behavior with JavaScript, you can create an interactive experience; even better, you can create full blown web applications.

A collection of images from inside the book.

Head First HTML5 Programming is your ultimate tour guide to creating web applications with HTML5 and JavaScript, and we give you everything you need to know to build them, including: how to add interactivity to your pages, how to communicate with the world of Web services, and how to use the great new APIs being developed for HTML5.

Here are just some of the things you'll learn in Head First HTML5 Programing:

  • Learn how to make your pages truly interactive by using the power of the DOM.
  • Finally understand how JavaScript works and take yourself from novice to well-informed in just a few chapters.
  • Learn how JavaScript APIs fit into the HTML5 ecosystem, and how to use any API in your web pages.
  • Use the Geolocation API to know where your users are.
  • Bring out your inner artist with Canvas, HTML5's new 2D drawing surface.
  • Go beyond just plugging a video into your pages, and create custom video experiences.
  • Learn the secret to grabbing five megabytes of storage in every user's browser.
  • Improve your page's responsiveness and performance with Web workers.
  • And much more.

Head First HTML5 Programming by Eric Freeman & Elisabeth Robson.

Read Me:
What you should know before reading this book

This is a learning experience, not a reference book. We deliberately stripped out everything that might get in the way of learning whatever it is we're working on at that point in the book. And the first time through, you need to begin at the beginning, because the book makes assumptions about what you've already seen and learned.

We expect you to know HTML and CSS.

If you don't know HTML markup (that is, all about HTML documents including elements, attributes, property structure, structure versus presentation), then pick up a copy of Head First HTML with CSS & XHTML before starting this book. Otherwise, you should be good to go.

Some experience helps, but we don't expect you to know JavaScript. If you've got any programming or scripting in your background (even if it isn't JavaScript), it's going to help you. But, we don't expect you to know JavaScript going into this book; in fact, this book is designed to follow Head First HTML with CSS & XHTML, which has no scripting in it.

We encourage you to use more than one browser with this book.

We encourage you to test the pages and web applications in this book with several browsers. This will give you experience in seeing the differences among browsers and in creating pages that work well in a variety of browsers. We most highly recommend Google Chrome and Apple Safari for use with this book as they are, in general, the most up-to-date with the current standards. But we do recommend you also try the most recent versions of the other major browsers including Internet Explorer, Firefox and Opera, as well as mobile browsers on devices with iOS and Android.

Software Requirements

To write HTML5 and JavaScript code, you need a text editor, a browser, and, sometimes, a web server (it can be locally hosted on your personal desktop). The text editors we recommend for Windows are PSPad, TextPad or EditPlus (but you can use Notepad if you have to). The text editors we recommend for Mac are TextWrangler, TextMate or TextEdit. If you're on a Linux system, you've got plenty of text editors built-in, and we trust you don't need us to tell you about them.

We hope you've got the browser bit covered and have installed at least two browsers (see the previous page). If not, do it now. It's also worth your time to learn how to use the browser developer tools; each of the major browsers has built-in tools you can use to inspect the JavaScript console (you can see errors as well as output you display using console.log, a handy alternative to alert), web storage usage, the DOM, CSS style that's been applied to elements, and much much more. Some browsers even have plug-ins for additional developer tools.

You don't need the developer tools to get through the book, but if you're willing to spend the time to investigate how to use these, it will make development easier. Some HTML5 features and JavaScript APIs require that you serve files from a real web server rather than by loading a file (i.e., your URL will start with http:// rather than file:// ). We've identified which examples you'll need a server for in the appropriate places in the book, but if you're motivated, we recommend you go ahead and install a server on your computer now. For Mac and Linux, Apache comes built-in, so you'll just need to make sure you know how to access it and where to put your files so you can serve them using your local server. For Windows, you'll need to install Apache or IIS; if you go the Apache route, there are plenty of open source tools like WAMP and XAMPP that are fairly easy to install.

That's it! Have fun...

Book code and downloads

Download the example files (all .zip files):
Order
(opens a new window)

Buy 2 books, get 1 free!

Buy 2 books and get the third free! Use the coupon code OPC10 when you check out.

Who is this book for?

For you if...

  • Do you have a computer with a web browser and a text editor?

  • Do you want to learn, understand, remember, and create web applications using the best techniques and most recent standards?
  • Do you prefer stimulating dinner party conversation to dry, dull, academic lectures?

Not for you if...

  • Are you completely new to writing web pages?
  • Are you already developing web apps and looking for a reference book on HTML5?
  • Are you afraid to try something different? Would you rather have a root canal than mix stripes with plaid? Do you believe that a technical book can't be serious if cheesy 50's educational films and anthropomorphized JavaScript APIs are in it?