Cross-Document Messaging
Web browsers prevent us from using scripts on one domain to affect or
interact with scripts on another domain. This restriction keeps end users safe
from cross-site scripting, which has been used to do all sorts of nasty things
to unsuspecting site visitors.
However, this prevents all scripts from working, even when we write them
ourselves and know we can trust the content. HTML5 includes a workaround
that is both safe and simple to implement. You’ll see how to make this work
in Tip 31, Talking across Domains, on page 213.
Web Sockets
HTML5 offers support for web sockets, which give you a persistent connection
to a server. Instead of constantly polling a back end for progress updates,
your web page can subscribe to a socket, and the back end can push notifi-
cations to your users. We’ll play with that in Tip 32, Chatting with Web
Sockets, on page 219.
Client-Side Storage
We tend to think of HTML5 as a web technology, but with the addition of the
Web Storage and Web SQL Database application programming interfaces
(APIs), we can build applications in the browser that can persist data entirely
on the client’s machine. You’ll see how to use those APIs in Chapter 9, Saving
Data on the Client, on page 183.
1.2 The Road to the Future Is Bumpy
A few roadblocks continue to impede the widespread adoption of HTML5 and
CSS3.
Handling Old Versions of Internet Explorer
Internet Explorer still has a large user base, and versions prior to IE9 have
very weak HTML5 and CSS3 support. Internet Explorer 10 improves this sit-
uation vastly, but it’s not widely used yet and won’t be made available to
people using Windows Vista or earlier operating systems. That doesn’t mean
we can’t use HTML5 and CSS3 in our sites anyway. We can make our sites
work in Internet Explorer, but they don’t have to work the same as the versions
we develop for Chrome and Firefox. We’ll just provide fallback solutions so
we don’t anger users and lose customers. You’ll learn plenty of tactics
throughout this book.
report erratum • discuss
The Road to the Future Is Bumpy • 5
Download from Wow! eBook <www.wowebook.com>