Sunday, 10 February 2013

Internet Explorer

Internet Explorer
Internet Explorer currently has the largest user base, and versions 8
and below have very weak HTML5 and CSS3 support. IE 9 improves this
situation, but it’s not widely used yet. 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.

A Platform for Web Development

A lot of the new features of HTML center around creating a better
platform for web-based applications. From more descriptive tags and
better cross-site and cross-window communication to animations and
improved multimedia support, developers using HTML5 have a lot of
new tools to build better user experiences.
More Descriptive Markup
Each version of HTML introduces some new markup, but never before
have there been so many new additions that directly relate to describing
content. You’ll learn about elements for defining headings, footers,
navigation sections, sidebars, and articles in Chapter 2, New Structural
Tags and Attributes, on page 24. You’ll also learn about meters,
progress bars, and how custom data attributes can help you mark up

Multimedia with Less Reliance on Plug-ins
You don’t need Flash or Silverlight for video, audio, and vector graphics
anymore. Although Flash-based video players are relatively simple
to use, they don’t work on Apple’s mobile devices. That’s a significant
market, so you’ll need to learn how to use non-Flash video alternatives.
In Chapter 7, Embedding Audio and Video, on page 127, you’ll see how
to use HTML5 audio and video with effective fallbacks.
Better Applications
Developers have tried all kinds of things to make richer, more interactive
applications on the We b, from ActiveX controls to Flash. HTML5
offers amazing features that, in some cases, completely eliminate the
need for third-party technologies.
Cross-Document Messaging
We b 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 Talking Across Domains,

Web Sockets
HTML5 offers support for We b 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 notifications to your users. We’ll play with that a bit
in Chatting with Web Sockets

How This Wor ks

Each chapter in this book focuses on a specific group of problems that
we can solve with HTML5 and CSS3. Each chapter has an overview
and a table summarizing the tags, features, or concepts covered in the
chapter. The main content of each chapter is broken apart into “tips,”
which introduce you to a specific concept and walk you through building
a simple example using the concept. The chapters in this book are
grouped topically. Rather than group things into an HTML5 part and a
CSS3 part, it made more sense to group them based on the problems
they solve.
Each tip contains a section called “Falling Back,” which shows you
methods for addressing the users who use browsers that don’t offer
HTML5 and CSS3 support. We’ll be using a variety of techniques to
make these fallbacks work, from third-party libraries to our own jQuery
plug-ins. These tips can be read in any order you like.
Finally, each chapter wraps up with a section called “The Future,”
where we discuss how the concept can be applied as it becomes more
widely adopted.

HTML5: The Platform vs. the Specification

HTML5 is a specification that describes some new tags and markup, as
well as some wonderful JavaScript APIs, but it’s getting caught up in
a whirlwind of hype and promises. Unfortunately, HTML5 the standard
has evolved into HTML5 the platform, creating an awful lot of confusion
among developers, customers, and even authors. In some cases, pieces

from the CSS3 specification such as shadows, gradients, and transformations
are being called “HTML.” Browser makers are trying to one-up
each other with how much “HTML5” they support. People are starting
to make strange requests like “My site will be in HTML5, right?”
For the majority of the book, we’ll focus on the HTML5 and CSS3 specifications
themselves and how you can use the techniques they describe.
In the last part of the book, we’ll look into a suite of closely related
specifications that were once part of HTML5 but are in use right now
on multiple platforms. These include We b SQL Databases, Geolocation,
and We b Sockets. Although these things aren’t technically HTML5, they
can help you build incredible things when combined with HTML5 and