HTML5 local database (SQLite) Example

Source: Internet
Author: User
According to the example of an HTML5 pioneer in China, I copied an example of using HTML5API to operate a local SQLite database. I feel that this function is quite fun, but it is not powerful enough, especially the browser is not powerful enough: HTML code :!

According to the example of an HTML5 pioneer in China, I copied an example of using HTML5API to operate a local SQLite database. I feel that this function is quite fun, but it is not powerful enough, especially the browser is not powerful enough: HTML code :!

According to the example of a pioneer in HTML5 in China, I copied an example of using HTML5 APIs to operate a local SQLite database. I feel that this function is quite interesting, but it is not powerful enough. In particular, the browser is not powerful enough:

HTML code:

Javascript encapsulates many methods, such as saving data to the database, updating, and synchronizing the list below.

I did a test on Google Chrome. The following is:

Chrome I am using the latest version. Suppose I have installed it in C: \ Documents ents and Settings \ charles. wang \ Local Settings \ Application Data \ Google \ Chrome

Then the SQLite database is installed in $ CHROME_HOME \ User Data \ Default \ databases.

In this directory, databases. db is the configuration of all the databases created by the current user, while the file _ 0 directory is the database table file directory:

You can use the SQLite management tool to open these two files:

Configure the Databases used in Databases. db:

This is the same as the setting in js:

When we open the database file, we can see that:

The records in these databases are displayed on the page.

Limitations:

Unfortunately, I tested the Firefox browser (Version 12) that programmers like most, the U.S. server. Unfortunately, it does not support this local database SQLite or virtual host, (I opened the Firebug console ):

I hope this problem can be improved in the future. After all, there are still many people using Firefox, especially programmers.

This article is from the "parallel line cohesion" blog, Hong Kong virtual host, please be sure to keep this source

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.