HTML5 and CSS3, Second Edition

(singke) #1

CHAPTER 10


Creating Interactive Web Applications


Beyond the new markup, styles, and multimedia capabilities of HTML5 and
CSS3 lie incredibly powerful application programming interfaces (APIs) for
making richer, more powerful web applications. We’ve already touched on
how to store data on the client’s machine, but we can go even farther. In this
chapter we’ll spend a little time working with the HTML5 History API, and
then we’ll make pages on different servers talk with the Cross-Document
Messaging API, Then we’ll look at Web Sockets and Geolocation, two very
powerful APIs that can help you make even more interactive applications.
We’ll wrap up by exploring HTML5’s Drag and Drop API support.

Many of these APIs started out as part of the HTML5 specification and were
eventually spun off into their own projects. Others were never part of HTML5
proper, but have become so associated with HTML5 that sometimes it’s hard
for developers to really tell the difference. But by combining what you’ve
already learned with these new features, you’ll be able to provide better
experiences for your users. Let’s start with a look at the History API.

We’ll use the following APIs in this chapter:


History
Manages the browser history. [C5, F3, S4, IE8, O10.1 iOS3.2, A2]

Cross-Document Messaging
Sends messages between windows and <iframe>s with content loaded on
different domains.[C5, F4, S5, iOS4.1, A2]

Web Sockets
Creates a stateful connection between a browser and a server. [C5, F6,
S5, IE10, O12.1, iOS6]

Download from Wow! eBook <www.wowebook.com> report erratum • discuss

Free download pdf