Example of using Web SQL in HTML 5: websql

Source: Internet
Author: User

Example of using Web SQL in HTML 5: websql

Web SQL simulates databases in a browser and can use JS to operate SQL to read and write data. However, this feature currently does not support many browsers, and its W3C specification has been discontinued, it seems that its prospects are not very clear.

W3C specification: http://www.w3.org/TR/webdatabase/#dom-sqltransaction-sync-executesql)

Supported browsers and versions:

Safari (3.2 +)
Chrome (3.0 +)
Opera (10.5 +)

Generally, offline applications use webstorage, but webstorage has many limitations, such as storage space and domain security mechanisms. web SQL has no restrictions, it has a larger storage space (customizable), cross-origin read/write, free storage structure, and other features. It is also very convenient to use SQL for read/write.

Sample Code

<Span style = "font-family: System; font-size: 18px;"> <! DOCTYPE html> 


For websql, due to the broad read/write rules, it brings about a lot of security issues. Cross-origin reading, XSS attacks, SQL injection, and so on are all very headaches. Therefore, consider carefully what data can be stored and how it is stored. W3C has stopped the update of this specification and may not be satisfied with the current specification design. Currently, browser vendors do not have a high level of support. The future development is still unknown.

 


Can I use HTML5 and SQL databases to implement a WEB-based Student Achievement Management System?

HTML is equivalent to the static Web page syntax. It can implement the page text and input functions. The background needs the support of Java, VBScript, and other programs. There are a lot of content in this aspect, we recommend that you search for related technologies by keywords such as ASP, Java, VBScript, and database links.

Html5 web SQL cannot delete records

Var SQL = "DELETE FROM StuInfo WHERE StuID =? "; Here is an error. Generally, var SQL =" DELETE FROM StuInfo WHERE StuID = ''+ [id] + ";

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.