2

Since the WebSQL has lost all the support and the development being stopped, how are people able to implement Offline Storage in web apps using HTML5. I know Google Chrome and Safari are still having it as a part of the browser but I guess soon it will be lost. So which are the technologies that are replacing it and what are the different things that need to be implemented to have an offline app rather than using webSQL?

Shiv Kumar Ganesh
  • 3,799
  • 10
  • 46
  • 85

3 Answers3

2

Chrome, Firefox and IE10 now also support IndexedDB, a replacement for WebSQL.

duri
  • 14,991
  • 3
  • 44
  • 49
  • how different is it from Local Storage? – Shiv Kumar Ganesh Jan 14 '12 at 18:11
  • @ShivKumarGanesh IndexedDB has a bit advanced API so some tasks can be done easier. Look at http://msdn.microsoft.com/library/hh673548.aspx – duri Jan 14 '12 at 18:25
  • 1
    @ShivKumarGanesh See [How is indexedDB conceptually different from HTML5 local storage?](http://stackoverflow.com/questions/5924485/how-is-indexeddb-conceptually-different-from-html5-local-storage) – robertc Jan 14 '12 at 22:08
1

HTML5 supports localStorage, which allows you to store large quantities of data on clients' computers, somewhat comparable to cookies. All major browsers support it by now. You can read all about it at http://diveintohtml5.info/storage.html.

Patrickdev
  • 2,341
  • 1
  • 21
  • 29
  • Just a note, cookies require each request to pass them along and increase bandwidth. localStorage and sessionStorage never pass data along and they don't have the same storage constraints as cookies. – King Friday Jan 14 '12 at 18:09
  • As the article states, with localStorage, you're limited to 5mb. If you need more, then you need use one of the other (non-standard) mechanisms :-( – Chuck Han Feb 07 '12 at 21:16
1

localStorage and sessionStorage are supported in all major browsers now.

If you use JSON2 (google Douglas Crockford and JSON2) you can serialize your JSON objects for local and session storage.

Its not as nice as using SQL queries but you can work with JSON pretty well and there are some plugins to help you.

King Friday
  • 25,132
  • 12
  • 90
  • 84