web-sql

WebSQL for PhoneGap Application [closed]

这一生的挚爱 提交于 2019-11-26 17:21:50
问题 I'm looking to use a WebSQL to store data in an Android PhoneGap app but dunno where to start. There is no need to retrieve data from the web as the application is offline, and I want to have a prepopulated database that can be queried. A few questions: How do you create a pre-populated database? (what kind of file format should it be) If there are two factors can be changed, how do I get the result of a combination of these factors from the database using SQL. Will the database be wiped if

Web SQL Database + Javascript loop

自古美人都是妖i 提交于 2019-11-26 14:39:43
问题 I'm trying to figure this out but can't seem to on my own... I'm playing with Web SQL DBs and I can't get a loop to work properly with it. I use: for (var i=0; i<=numberofArticles-1; i++){ db.transaction(function (tx) { tx.executeSql('INSERT INTO LOGS (articleID) VALUES (?)', [i]); }); }; And I get only 5's.. I don't get the incremental i values. Can anyone suggestion what I'm doing wrong and what I should be thinking about? 回答1: It looks like the function is asynchronous, and that by the