There are several ways to websql storage:
OpenDatabase: This method uses an existing database or creates a new database to create a database object.
Transaction: This method allows us to perform transaction processing;
ExecuteSQL: This method is used to execute SQL statements;
1 var db = OpenDatabase (name,version,displayname,estimatesize,creationcallback);
Name: Names of databases;
Version: The revision number of the database;
DisplayName: Description of the database;
Estimatesize: The size of the database to hold data;
Createcallback: callback function:
2 calling transaction to execute SQL statements
Transaction (function (TX) {})
TX: The parameter received by the callback function, which is a reference to the transaction object.
3 Calling the ExecuteSQL method to represent processing transactions
Transaction.executesql (Sql,[],datahandler,errorhandler);
SQL: The SQL statement to execute;
[placeholder in]:sql statement]? "the corresponding parameter.
DataHandler: The callback function invoked when the Execute SQL statement succeeds:
ErrorHandler: The callback function that is called when the Execute SQL statement fails.
Post Code First
<! DOCTYPE html> Websql for Instant Messaging