TechChee.com

TechChee.com, gadgets, gizmo and hot tech stuff

We bring you interesting topics of hot gadgets and high tech stuff

 

WebKit has JavaScript API for client-side database storage

WebKit has JavaScript API for client-side database storage
WebKit has got some cool asynchronous API that follows one of the specs of the HTML 5 i.e. allows you to write JavaScript code to store data, using SQL statements that you’ve been familiar with, so data can be stored on the client’s computer. This should work more or less similar to one of the features that the Google Gears offer – the Local Database API. This would be useful for those applications that wanna store more information on the client sides, a much better way and easier to manipulate by using SQL statements instead of nasty cookies. More info and code after the jump!

Some usage of Javascript code of Webkit’s API is as follows:

var database = openDatabase(“Database Name”, “Database Version”);

database.executeSql(“SELECT * FROM test”, function(result1) {
// do something with the results
database.executeSql(“DROP TABLE test”, function(result2) {
// do some more stuff
alert(“My second database query finished executing!”);
});
});

via  More on Webkit blog

Leave a Reply

You must be logged in to post a comment.

Grab the FREE TechChee for iPhone from Apple App Store now to read TechChee news on your iPhone, iPad or iPod Touch.

TechChee for iPhone available on Apple App Store

Follow techchee on Twitter