O'Reilly logo

HTML5 Multimedia Development Cookbook by Lee Jordan, Dale Cruse

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

Testing browsers for data storage support

Knowing how to test quickly whether a browser supports a data storage method you want to use will make developing pages and applications easier. In this recipe, we will create a script that queries a browser's DOM to test for support of different data storage methods.

Getting ready

You will need access to a modern browser such as Firefox 3.6, or the latest versions of a popular browser such as Google Chrome, Opera, Safari, or Internet Explorer.

How to do it...

First, we are going to create a simple html page. Open an HTML editing program or a text editor, and enter the starting code for a basic HTML5 page:

<!doctype html><html lang="en"><head><title>Client-side Storage Test for HTML5</title> <meta charset="utf-8"> ...

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

Start Free Trial

No credit card required