Created
January 27, 2013 12:14
-
-
Save glynrob/4648098 to your computer and use it in GitHub Desktop.
WebSQL try to create database and table
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var itemCount = 0; // default value for label | |
try { | |
var db = openDatabase('mydb', '1.0', 'my_data', 2 * 1024 * 1024); | |
db.transaction(function (tx) { | |
tx.executeSql('CREATE TABLE IF NOT EXISTS data (id unique, text)'); | |
}); | |
} catch( error ) { | |
alert('Your browser is not supported for WebSQL - Please use Chrome or Safari'); | |
} | |
var savedData = []; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment