【问题标题】:Using Local Database w/ JQuery Mobile?将本地数据库与 JQuery Mobile 一起使用?
【发布时间】:2011-10-17 20:28:35
【问题描述】:
我正在使用 JQuery 编写一个 Web 应用程序。我的应用程序将主要在 Android 上运行。我想在客户端有一个本地数据库,以便我的 Web 应用程序可以将数据存储在客户端的浏览器中,并且即使在 Internet 连接中断时也可以工作。我看到有很多选项,例如插件、jStorage、HTML5 WebStorage、ixedit 等等;但是,我想从有知识和经验的人那里得到意见。
你会建议什么解决方案?
谢谢!
附言如果我可以在本地数据库上使用 SQL,那就更好了。
【问题讨论】:
标签:
jquery
android
database
local-storage
【解决方案1】:
查看:localStorageDB 插件
localStorageDB is a simple layer over localStorage that provides a set of functions to store structured data like databases and tables. It provides basic insert/update/delete/query capabilities. localStorageDB has no dependencies, and is not based on WebSQL. Underneath it all, the structured data is stored as serialized JSON in localStorage.
数据的创建、操作、删除、查询等非常简单,其编码是纯JQuery。
编辑:如果您更喜欢基于 SQL 的解决方案,您可以尝试来自here的HTML 5 Web SQL 数据库