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 ...