Zend Certified Engineer

phpguru.org

Quality PHP, Javascript and C# code
Download RGraph: HTML5 canvas graph library... Home ~ Downloads ~ FAQs ~ Licensing
RSS Feed RSS Feed
Follow me on Twitter Follow me on Twitter

Articles

HTML5

Javascript

PHP5

PHP4




Bookmark with delicious Stumble! this site tweet this site Buzz this!

Javascript registry class using HTML5 DOM storage


24th June 2009

[Direct URL for this article]

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.



RGraph: HTML5 canvas graph library

Example graph made using RGraph

If you're interested in web development, then you may also be interested in RGraph: HTML5 canvas graph library. It uses HTML5 features to produce a wide variety of graph types. Because it moves the creation of graphs from the server to the client, it can significantly reduce the load on your server and your bandwidth usage.