Skip to main content

2011 | Buch

Pro HTML5 Programming

verfasst von: Peter Lubbers, Brian Albers, Frank Salim

Verlag: Apress

insite
SUCHEN

Über dieses Buch

HTML5 is here, and with it, web applications have acquired power, ease, scalability, and responsiveness like never before. With this book, developers will learn how to use the latest cutting-edge HTML5 web technology—available in the most recent versions of modern browsers—to build web applications with unparalleled functionality, speed, and responsiveness.

This new edition includes major revisions for WebSockets functionality, reflecting the new W3C specification. It also features new chapters covering the drag-and-drop API as well as SVG.

Explains how to create real-time HTML5 applications that tap the full potential of modern browsers Provides practical, real-world examples of HTML5 features in action Covers all the new HTML5 APIs to get you up-to-speed quickly with HTML5 Fully updated to include the latest revisions of the WebSocket API, and much more.

Inhaltsverzeichnis

Frontmatter
Chapter 1. Overview of HTML5
Abstract
This book is about HTML5 Programming. Before you can understand HTML5 programming, however, you need to take a step back and understand what HTML5 is, a bit of the history behind it, and the differences between HTML 4 and HTML5.
Peter Lubbers, Brian Albers, Frank Salim
Chapter 2. Using the Canvas API
Abstract
In this chapter, we’ll explore what you can do with the Canvas API—a cool API that enables you to dynamically generate and render graphics, charts, images, and animation. We’ll walk you through using the basics of the rendering API to create a drawing that can scale and adjust to the browser environment. We’ll show you how to create dynamic pictures based on user input in a heatmap display. Of course, we’ll also alert you to the pitfalls of using Canvas and share tricks to overcome them.
Peter Lubbers, Brian Albers, Frank Salim
Chapter 3. Working with Scalable Vector Graphics
Abstract
In this chapter, we’ll explore what you can do with another graphics feature in HTML5: Scalable Vector Graphics. Scalable Vector Graphics, or SVG, is an expressive language for two dimensional graphics.
Peter Lubbers, Brian Albers, Frank Salim
Chapter 4. Working with Audio and Video
Abstract
In this chapter, we’ll explore what you can do with two important HTML5 elements—audio and video—and we’ll show you how they can be used to create compelling applications. The audio and video elements add new media options to HTML5 applications that allow you to use audio and video without plugins while providing a common, integrated, and scriptable API.
Peter Lubbers, Brian Albers, Frank Salim
Chapter 5. Using the Geolocation API
Abstract
Let’s say you want to create a web application that offers discounts and special deals on running shoes in stores that your application’s users are within walking (or running) distance away from. Using the Geolocation API, you can request users to share their location and, if they agree, you can provide them with instructions on how to get to a nearby store to pick up a new pair of shoes at a discounted rate.
Peter Lubbers, Brian Albers, Frank Salim
Chapter 6. Using the Communication APIs
Abstract
In this chapter, we’ll explore what you can do with two of the important building blocks for real-time, cross-origin communication: Cross Document Messaging and XMLHttpRequest Level 2 and we’ll show you how they can be used to create compelling applications. Both of these building blocks add new communication options to HTML5 applications and allow applications served from different domains to safely communicate with each other.
Peter Lubbers, Brian Albers, Frank Salim
Chapter 7. Using the WebSocket API
Abstract
In this chapter, we’ll explore what you can do with the most powerful communication feature in the HTML5 specification: WebSocket, which defines a full-duplex communication channel that operates through a single socket over the web. WebSocket is not just another incremental enhancement to conventional HTTP communications; it represents a large advance, especially for real-time, eventdriven web applications.
Peter Lubbers, Brian Albers, Frank Salim
Chapter 8. Using the Forms API
Abstract
In this chapter, we’ll explore all the new capabilities at your command with a longstanding technology: HTML Forms. Forms have been the backbone of the explosion of the Web since they first appeared. Without form controls, web business transactions, social discussions, and efficient searches would simply not be possible.
Peter Lubbers, Brian Albers, Frank Salim
Chapter 9. Working with Drag-and-Drop
Abstract
Traditional drag-and-drop has been popular with users since the days of the original Apple Macintosh. But today’s computers and mobile devices have much more sophisticated drag-and-drop behavior. Drag-and-drop is used in file management, transferring data, diagramming, and many other operations where moving an object is more naturally envisioned with a gesture than a key command. Ask developers on the street what drag-and-drop encompasses, and you are likely to get a myriad of different answers depending on their favorite programs and current work assignments. Ask non-technical users about drag-and-drop, and they may stare at you blankly; the feature is now so ingrained into computing that it does not often get called out by name anymore.
Peter Lubbers, Brian Albers, Frank Salim
Chapter 10. Using the Web Workers API
Abstract
JavaScript is single-threaded. As a result, long-lasting computations (not necessarily due to poorly written code) will block the UI thread and make it impossible to add text to text boxes, click buttons, use CSS effects, and, in most browsers, open new tabs until control has returned. As an answer to that problem, HTML5 Web Workers provide background-processing capabilities to web applications and typically run on separate threads so that JavaScript applications using Web Workers can take advantage of multicore CPUs. Separating long-running tasks into Web Workers also avoids the dreaded slow-script warnings, shown in Figure 10-1, that display when JavaScript loops continue for several seconds.
Peter Lubbers, Brian Albers, Frank Salim
Chapter 11. Using the Storage APIs
Abstract
In this chapter, we will explore what you can do with HTML5 Web Storage—sometimes referred to as DOM Storage—an API that makes it easy to retain data across web requests. Before the Web Storage API, remote web servers needed to store any data that persisted by sending it back and forth from client to server. With the advent of the Web Storage API, developers can now store data directly on the client side in the browser for repeated access across requests or to be retrieved long after you completely close the browser, thus reducing network traffic.
Peter Lubbers, Brian Albers, Frank Salim
Chapter 12. Creating Offline Web Applications
Abstract
In this chapter, we will explore what you can do with offline HTML5 applications. HTML5 applications do not necessarily require constant access to the network, and loading cached resources can now be more flexibly controlled by developers.
Peter Lubbers, Brian Albers, Frank Salim
Chapter 13. The Future of HTML5
Abstract
As you have already seen in this book, HTML5 provides powerful programming features. We also discussed the history behind HTML5’s development and HTML5’s new plugin-free paradigm. In this chapter, we will look at where things are going. We will discuss some of the features that are not fully baked yet but hold tremendous promise.
Peter Lubbers, Brian Albers, Frank Salim
Backmatter
Metadaten
Titel
Pro HTML5 Programming
verfasst von
Peter Lubbers
Brian Albers
Frank Salim
Copyright-Jahr
2011
Verlag
Apress
Electronic ISBN
978-1-4302-3865-2
Print ISBN
978-1-4302-3864-5
DOI
https://doi.org/10.1007/978-1-4302-3865-2