IndexedDB,WebSQL在4个月内 [英] IndexedDB, WebSQL in 4 Months

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

问题描述

我有一个问题,我要开始一个为期4-6个月的项目,该项目需要离线支持. AppCache很棒,已被接受为标准,但是大型浏览器仍不确定如何在Opera,Safari和Chrome中选择使用WebSQL(SQLite)和Mozilla以及IE支持IndexedDB来实现数据库.

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 IndexedDB.

我知道Chrome将来还会开发IndexedDB选项,但我找不到有关任何发行日期等的任何信息.

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

现在,将其命名为11月4-6个月,我想拥有一个支持大多数(不一定是全部)最新版本浏览器(假设IE9退出,FF4和Chrome 6)的系统.我真的不想有一个IndexedDB/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 IndexedDB/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

推荐答案

我确实会(a.o.)进行本地存储.我在今年早些时候写了这样一个脱机网络应用程序的小概念证明(cfr.此处已离线启用的网络应用程序),基本方法是;

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;

  • 将数据放入数组/对象
  • 使用标准的javascript函数执行CRUD(或使用 jlinq )
  • 通过json-ify数组/对象进行存储
  • 使用类似 persistjs 的存储抽象库来存储/检索json定义的数组/对象
  • 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

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

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