Skip to content

wojodesign/local-storage-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

/**********************************************************/
	Cross Browser HTML5 Local Storage Support
/**********************************************************/
Brett Wejrowski
Wojo Design
wojodesign.com
[email protected]


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

About

Cross Browser HTML5 Local Storage Polyfill

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published