Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Cross Browser HTML5 Local Storage Polyfill

branch: master
README
/**********************************************************/
	Cross Browser HTML5 Local Storage Support
/**********************************************************/
Brett Wejrowski
Wojo Design
wojodesign.com
brett@wejrowski.com


The script implements a replacement for HTML5's localStorage when it is not supported.  
It implements a nearly identical interface using userData for IE6-7 and globalStorage 
for FF2-3.  You can find the spec of the HTML5 storage at 
	http://www.w3.org/TR/2009/WD-webstorage-20091222/
	


localStorage.setItem( key , value );
// saves a new name/value pair if the key doesn't exist, otherwise
// updates the value

localStorage.getItem( key );
// returns the value associated with the given key, if it exists
// returns null if the key doesn't exist

localStorage.length;
// the number of unique keys stored 

localStorage.removeItem( key );
// deletes the name/value pair with the given key, if it exists
// if it does not exist, exits

localStorage.clear();
// delete all name/value pairs currently stored

localStorage.key( n );
// returns the name of the nth key in the list, will return null if n is
// greater than or equal to localStorage.length
Something went wrong with that request. Please try again.