Last active
August 29, 2015 14:10
-
-
Save pbalduino/a86e24f499a216c25056 to your computer and use it in GitHub Desktop.
Small sample of HTML5 Local Storage
This file contains hidden or 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
| if(localStorage["demo.isRunning"] !== "true") { | |
| alert("Let's write something on the local storage"); | |
| localStorage["demo.isRunning"] = true; | |
| localStorage["demo.value"] = "It works!"; | |
| window.location.reload(); | |
| } else { | |
| alert("Value of stored value is '" + localStorage["demo.value"] + "'"); | |
| localStorage.removeItem("demo.isRunning"); | |
| localStorage.removeItem("demo.value"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment