Created
December 21, 2011 21:47
-
-
Save damienalexandre/1507857 to your computer and use it in GitHub Desktop.
Web Storage API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Stocker une valeur | |
sessionStorage.setItem('key', 'value'); | |
localStorage.setItem('key', 'value'); | |
// Récupérer une valeur | |
var item = sessionStorage.getItem('key'); | |
var item = localStorage.getItem('key'); | |
// Supprimer une valeur | |
sessionStorage.removeItem('key'); | |
localStorage.removeItem('key'); | |
// Supprimer toutes les valeurs | |
sessionStorage.clear(); | |
localStorage.clear(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment