A quick tutorial for WebSQL

I've created a gist which gives you the basics for getting to grips with WebSQL. It's heavily commented and shows you the three core methods used (openDatabase,transaction,executeSql) and how to:

  1. Create a database
  2. Create a table
  3. Insert a record
  4. Get the data back in to HTML

Don't forget that WebSQL is currently only supported on Chrome, Opera, iPhone, and Android. It's not on Firefox(!) or Internet Explorer (shock).

To see your results right click on the page and Inspect Element to bring up the following window and go to the Resources tab. Under Databases you should find a table called fightclub

inspect element

Posted: 12-Jan-2012

View: 1204

Permalink: here

Comments

great) liked everything very much) keep it up and dont stop)

#1 Jon
02/Feb/12 5:54 PM