0

我想在 firefox os 上使用 Phonegap,但我在存储 api 上有问题。当前的 cordova 版本 3.0,支持 websql 和 localstorage API。它还没有 indexedDB API。所以,我目前的选择是使用 Lawnchair。

但是你对如何为此设计一个持久层有一个好主意。你有什么建议?

请告诉我。谢谢你。

4

2 回答 2

2

您可以尝试使用 localForage:

https://github.com/mozilla/localforage

引用一下,“localForage 是一个方便的库,它通过使用异步存储(通过 IndexedDB 可用)但使用简单的类似 localStorage 的 API 来改善您的 Web 应用程序的离线体验。”

于 2013-12-04T22:52:12.237 回答
1

If your app is for Firefox OS only you can use the indexedDB API directly, it's already supported without plugins.

For other platforms, there is a cordova indexdb plugin being developed that might help, you can find it on github here. It uses indexedDBShim which could also be helpful.

于 2014-05-06T01:17:36.513 回答