Javascript registry class using HTML5 DOM storage
24th June 2009
This is a simple wrapper around the local and session storage API. It doesn't do anything special, it's just a nicer API.
| Storage type: | Name: | Value: | ||
|---|---|---|---|---|
You can get the code here.
Usage
// Create the registry, this can be "session" or "local" and defaults to "session" anyway.
settings = new Registry('session');
// Store something in the registry
settings.Set('name', 'value');
// Get it back from the registry
myVar = settings.Get('name');
Compatibility
With it being HTML5, only the following browsers are supported:
- Firefox 3.5
- Safari 4
- Internet Explorer 8 (!)
Update - 27th June 2009
Just read that if you want to find out what's in the storage areas, you can find that information out by using the "databases" option in Safaris introspection tool. Very useful.