-
Book Overview & Buying
-
Table Of Contents
HTML5 Multimedia Development Cookbook
In this recipe we will create a web SQL database and give it attributes that define its version, name, size, and description.
You will need to be using a current browser that supports web SQL databases.
Create a new HTML5 file, and place opening and closing script tags between two footer tags. Declare a variable named db, then assign openDatabase() to it. Give openDatabase the following arguments: 'mymotodb', '1.0', 'Motocross Rider List DB', 2 * 1024 * 1024, and then close the declaration. The code should look like the following snippet:
<script>var db = openDatabase('mymotodb', '1.0', 'Motocross Rider List DB', 2 * 1024 * 1024);</script>
Save the file.
All web SQL databases use the openDatabase method to assign values to a database. The first argument "mymotodb" was the name of the database. The next and required argument was the version number. The number here must match whenever the user attempts to use...
Change the font size
Change margin width
Change background colour