O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Programming HTML5 Applications

Book Description

HTML5 is not just a replacement for plugins. It also makes the Web a first-class development environment by giving JavaScript programmers a solid foundation for building industrial-strength applications. This practical guide takes you beyond simple site creation and shows you how to build self-contained HTML5 applications that can run on mobile devices and compete with desktop apps.

You’ll learn powerful JavaScript tools for exploiting HTML5 elements, and discover new methods for working with data, such as offline storage and multithreaded processing. Complete with code samples, this book is ideal for experienced JavaScript and mobile developers alike.

  • Store session data in the browser with local storage objects
  • Save trips to the server: store larger amounts of data with IndexedDB
  • Give browsers limited access to a user’s system to read and upload files
  • Take your app offline—and speed up page loading when it’s online
  • Use Web Workers to create multithreaded applications
  • Transfer data between browser and server more efficiently with Web Sockets
  • Learn about HTML5 tags for forms, multimedia, graphics, and geolocation

"HTML5 is all the rage these days, but it's more than just a buzzword. Programming HTML5 Applications provides the knowledge to guide you through all the new technologies needed to make modern web applications."

--Ralph Whitbeck, cohost of The Official jQuery Podcast

Table of Contents

  1. Programming HTML5 Applications
  2. Preface
    1. How This Book Is Organized
    2. Conventions Used in This Book
    3. Using Code Examples
    4. Safari® Books Online
    5. How to Contact Us
    6. Acknowledgments
  3. 1. The Web As Application Platform
    1. Adding Power to Web Applications
    2. Developing Web Applications
    3. JavaScript’s Triumph
  4. 2. The Power of JavaScript
    1. Nonblocking I/O and Callbacks
    2. Lambda Functions Are Powerful
    3. Closures
    4. Functional Programming
    5. Prototypes and How to Expand Objects
    6. Expanding Functions with Prototypes
    7. Currying and Object Parameters
    8. Array Iteration Operations
    9. You Can Extend Objects, Too
  5. 3. Testing JavaScript Applications
    1. QUnit
      1. A Simple Example
      2. Testing with QUnit
    2. Selenium
      1. Selenium Commands
      2. Constructing Tests with the Selenium IDE
      3. Automatically Running Tests
      4. Selenese Command Programming Interface
      5. Running QUnit from Selenium
      6. Selenium RC and a Test Farm
  6. 4. Local Storage
    1. The localStorage and sessionStorage Objects
      1. Using localStorage in ExtJS
      2. Offline Loading with a Data Store
      3. Storing Changes for a Later Server Sync
    2. JQuery Plug-ins
      1. DSt
      2. jStore
  7. 5. IndexedDB
    1. Adding and Updating Records
    2. Adding Indexes
    3. Retrieving Data
    4. Deleting Data
  8. 6. Files
    1. Blobs
    2. Working with Files
    3. Uploading Files
    4. Drag-and-Drop
    5. Putting It All Together
    6. Filesystem
  9. 7. Taking It Offline
    1. Introduction to the Manifest File
      1. Structure of the Manifest File
      2. Updates to the Manifest File
    2. Events
    3. Debugging Manifest Files
  10. 8. Splitting Up Work Through Web Workers
    1. Web Worker Use Cases
      1. Graphics
      2. Maps
    2. Using Web Workers
      1. The Worker Environment
      2. Worker Communication
    3. Web Worker Fractal Example
    4. Testing and Debugging Web Workers
    5. A Pattern for Reuse of Multithread Processing
    6. Libraries for Web Workers
  11. 9. Web Sockets
    1. The Web Sockets Interface
    2. Setting Up a Web Socket
    3. Web Socket Example
    4. Web Socket Protocol
      1. Ruby Event Machine
      2. Erlang Yaws
  12. 10. New Tags
    1. Tags for Applications
    2. Accessibility Through WAI-ARIA
    3. Microdata
    4. New Form Types
    5. Audio and Video
    6. Canvas and SVG
    7. Geolocation
    8. New CSS
  13. A. JavaScript Tools You Should Know
  14. Index
  15. About the Author
  16. Colophon
  17. Copyright