IndexDB,WebSQL在4个月 [英] IndexDB, WebSQL in 4 Months

查看:703
本文介绍了IndexDB,WebSQL在4个月的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,我要开始一个4-6个月的项目,需要离线支持。 AppCache是​​真棒和接受作为标准,但大浏览器仍然未决定关于数据库实施与Opera,Safari和Chrome选择WebSQL(SQLite)和Mozilla和据称IE支持IndexDB。

I've got a bit of a problem, I'm about to start a 4-6 month project which will need offline support. AppCache is awesome and accepted as the standard but the big browsers are still undecided about the database implementation with Opera, Safari and Chrome opting for WebSQL (SQLite) and Mozilla and supposedly IE backing IndexDB.

我知道Chrome将来还会开发一个IndexDB选项,但是我找不到任何发布日期的信息等。

I know that Chrome will also develop an IndexDB option in the future but I could not find any info about any release dates etc.

现在, 6个月,让我称它为11月我想有一个系统,支持大多数(不一定是所有)最新版本的浏览器(假设IE9是出,FF4和Chrome 6)。我真的不想有一个indexdb / websql双重实现。使用localStorage作为一个非常糟糕的blob数据库的想法让我很不舒服,我不想使用Gears。

Now, in 4-6 months, lets call it November I want to have a system that supports most (does not have to be all) latest version browsers (assuming IE9 is out, FF4, and Chrome 6). I don't really want to have a indexdb/websql dual implementation. The thought of using localStorage as a big ugly blob database gives me the shivers and I would love not to use Gears.

你是什么,我尊敬的同事推荐我做,我应该遵循什么路径?

What do you, my esteemed colleagues recommend I do, what path should I follow? Which pill to take?

感谢所有

Guido

推荐答案

我会去(ao)localstorage。我在今年早些时候写了一个小型的离线网络应用程序的概念证明(cfr。此博客离线启用的webapp here ),基本方法是:

i would indeed go for (a.o.) localstorage. I wrote a small proof of concept of such an offline web-app earlier this year (cfr. this blogpost and the offline-enabled webapp here), the basic approach being;


  • 将数据放入数组/对象中

  • use标准的javascript函数来做CRUD(或去 jlinq

  • json-ify用于存储的数组/对象

  • 使用存储抽象库,如 persistjs 以存储/检索json-ified数组/对象

  • put data in arrays/ objects
  • use standard javascript functions to do CRUD (or go for jlinq)
  • json-ify the array/object for storage
  • use a storage-abstraction library like persistjs to store/ retrieve json-ified array/object

这篇关于IndexDB,WebSQL在4个月的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆