javascripthtmlfirebugoffline-storage

HTML5 - Getting Started Using Offline Storage


I am following a tutorial to setup Offline Storage. I picked a compatible browser, FireFox 4.0.1. According to the Site that is all I need. Yet, somehow it does not work.

My code blows up in Javascript on this line.

var db = window.openDatabase("scores", "", "Previous Scores", 1024 * 1000);

I don't know what error is being thrown. I F11 to try to step into this line in Firebug, but nothing happens after that.

I am surprised this line is called without checking if the DB exists (I didn't install SQL express I guess it comes with the browser now nor did I setup the DB table).

What can I do to fix this?


Solution

  • Your are confusing the (abandoned) Web SQL Database API for the Web Storage API. The SQL API is only supported in Safari, while Web Storage (also called localStorage) is widely supported.