views:

623

answers:

3

I was originally looking for a basic tutorial on how to get started using client-side databases in FF3.5. My understanding was that this feature is support in FF, Safari, and IE8. However, I'm running into a pretty basic problem, which is that the syntax to created such a database doesn't seem to be found in FF3.5.

For example, to create a new db:

  var database = window.openDatabase("Database Name", "Database Version");

However, in FF3.5 window.openDatabase is not found. It is found in Safari 4 using that syntax. I haven't tested IE8 so I don't know about that.

Does someone have some more information about this?

A: 

My understanding was that this feature is support in FF, Safari, and IE8

Nope, it's only in WebKit (Safari/Chrome), and also via Gears.

You may be thinking of the simpler Local/Session Storage feature, which just stores unstructured data. This is supported by Firefox 3.5, IE8 and Safari, but not Chrome.

bobince
+4  A: 

You may be thinking of localStorage and sessionStorage, which are part of the W3C Web Storage API.

IE8 and Fx 3.5 support the above properties. Check the vendor documentation (developer.mozilla.org for Firefox).

Firefox doesn't support the real DB yet (tracking bug) and it's not clear that the current proposal (just make sqlite available to web pages) is the right one or the one that will be implemented in all browsers (see e.g. this post from Vlad Vukićević, a Mozilla developer)

Will Peavy
A: 

I think you are talking about this W3C's WebSimpleDB. However I don't know how mature or widely supported it is.

If you are looking to store data in the client there is also http://taffydb.com/ which is a simple JavaScript DB that lives in the browser.

Roberto Rosario