JS HTML5 Operation SQLite

Source: Internet
Author: User

Execute Query $ ("#btnSQL"). Tap (function () {<span style= "white-space:pre" ></span>var db = OpenDatabase (' MyDB ', '  1.0 ', ' Test DB ', 2 * 1024 * 1024); Db.transaction (Function (TX) {<span style= "White-space:pre" ></span>tx.executesql (' CREATE tabl     E IF not EXISTS testhtml (id unique, contenttext) '); <span style= "White-space:pre" ></span>tx.executesql (' insert into testhtml (contenttext) VALUES (' Insert        Data test1! ");}); <span style= "White-space:pre" ></span>db.transaction (function (TX) {tx.executesql (' SELECT * from          Testhtml ', [],function (Tx,result) {<span style= "white-space:pre" ></span>var len=result.rows.length;    <span style= "White-space:pre" ></span>app.alert (len);    <span style= "White-space:pre" ></span>var str=result.rows.item (0);        <span style= "White-space:pre" ></span>app.alert (Str.contenttext); <span style= "White-space:pre" ></span>},null); <span style= "White-space:pre" &GT;&LT;/SPAN&GT;}); });

JS HTML5 Operation SQLite

Related Article

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.