web-sql

WebSQL passing values in as parameter

孤街浪徒 提交于 2019-12-11 13:07:26
问题 I am using Phonegap and I am following the guide on their site but it gives me this function. function populateDB(tx) { tx.executeSql('DROP TABLE IF EXISTS DEMO'); tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)'); tx.executeSql('INSERT INTO DEMO (id, data) VALUES (1, "First row")'); tx.executeSql('INSERT INTO DEMO (id, data) VALUES (2, "Second row")'); } function errorCB(err) { alert("Error processing SQL: "+err.code); } function successCB() { alert("success!"); } var db =

Format date in websql

自闭症网瘾萝莉.ら 提交于 2019-12-11 11:44:19
问题 I am using websql, but problem is, not finding any date functions in websql. I have date stored in the format Mon Apr 09 2012 15:23:54 GMT+530(India Standard Time) , and I want the query result in the format 04/09/2012 . Can any body help please? 回答1: WebSql has a strftime function that should do what you need: select strftime('%d-%m-%Y', 'now') formattedDate As noted in the comment below, the data in the column will need to be a valid date time string recognized by SQLite. Check the SQLite

Search words in any order using JS

落爺英雄遲暮 提交于 2019-12-11 08:16:39
问题 I have code to search the typed words from the text box, Get the typed word, search it in the web sql database and show the result in the HTML page. In that i can search the word exactly as it is, using LIKE . (i.e) SELECT * FROM tblName WHERE SearchWord LIKE %<typedword>% If the table has, Hello Doctor Hi Sir Hello World Welcome Programmer And the user types as " Hello ", it shows me **Hello** Doctor **Hello** World I need to display the result even if the user wrongly arranges the words, i

Does WEBSQL support Phonegap Apps on Ice Cream Sandwich?

给你一囗甜甜゛ 提交于 2019-12-10 23:12:19
问题 We're currently developing a iPhone/Android app with phonegap (and sencha touch), with a WEBSQL Database. Everything is working fine on the iOS and on all the Android versions, except for Ice Cream Sandwich. The problem until now has nothing to do with design, it's because the database is not loaded. The different tables are created, but without its content. This gets me to the question, is WEBSQL supporting apps on Ice Cream Sandwich? Or did anyone have a similiar problem with this on ICS 4

HTML5 Web SQL Database Concerns

佐手、 提交于 2019-12-10 18:43:54
问题 My company is currently transitioning to a new architecture, as well as a model that provides services to mobile devices. Our application was traditionally web based ( HTML5/CSS3/JS/PHP/MYSQL ), so we want to be able to port it to mobile platforms without having to reinvent the wheel ( Cordova ), as well as to desktops in a standalone fashion ( AppJS ) so that we don't have to worry about browser-dependent bugs. We are also transitioning away from PHP to NodeJS to make this more feasible. The

How to make a WebSQL query synchronous?

非 Y 不嫁゛ 提交于 2019-12-10 12:48:38
问题 Consider: var globalvar; function viewyearmain() { db.transaction(function (tx) { tx.executeSql('SELECT * FROM BUDGET WHERE holdingtype="month"', [], function (tx, results) { var len = results.rows.length; msg = len; globalvar = msg; }, null); }); if (globalvar>0) { alert("ROWS FOUND"); } else { alert("ROWS NOT FOUND"); } } The problem is that ROWS NOT FOUND appears because the transaction has not completed by the time the if statement is reached. 回答1: An asynchronous callback is not

Mobile HTML5 Application Local Storage

不想你离开。 提交于 2019-12-10 00:03:02
问题 A quick overview of what I have, and the problems that are associated with it. I have a HTML5 app that I am going to run as a native app using PhoneGap. It is a small data collection application for the local field research station. The problem with this field station is that they are prone to loosing a signal to transmit data; thus I want to store the data on the device for later use (or to send it to a server). Data that needs to get saved is the following: *User Name (string) *Transect

Chrome Extension: WebQL database is not appearing in Inspector

亡梦爱人 提交于 2019-12-08 12:39:15
问题 I am trying to create database and tables in background.js file of Chrome but somehow it's not being created. When I see in Chrome Inspector > Resources > WebSQL, I find nothing. Code is given below: function fetchData(){ var xhr = new XMLHttpRequest(); xhr.open("GET", "http://localhost/php/fetch.php", true); xhr.onreadystatechange = function() { if (xhr.readyState == 4) { // JSON.parse does not evaluate the attacker's scripts. var resp = xhr.responseText; if(resp != null) { var json = JSON

WKWebView gives SecurityError when bundling html and javascript with app

爱⌒轻易说出口 提交于 2019-12-08 04:03:00
问题 We are trying to migrate a hybrid app from UIWebView (iOS < 8) to WKWebView (iOS 8), but we are getting SecurityErrors when trying to store stuff using the DOM WebDatabase API (i.e. 'web sql databases'). The following throws an error if the index.html has been loaded from a bundled file with the app // throws SecurityError: DOM Exception 18 var db = openDatabase('mydb', '1.0', 'key value store', 1); The same code works fine with UIWebView. I can fallback to using Local Storage for some reason

localStorage no longer working in iOS 7 WebView

╄→尐↘猪︶ㄣ 提交于 2019-12-08 02:53:51
问题 I am developing an HTML5 web app that is run from a WebView inside an iOS app. Once the users upgrade to iOS7, localStorage stops working and the app (which uses jQuery/jQuery Mobile) just shows the spinner. I've run some tests using Modernizr and it does not detect support for localStorage in the WebView within the app. This is strange, because it works fine in Safari on the iPad with iOS7. Has anyone else run into this issue or have a magical fix? The only client-side web storage API that