Last active
August 29, 2015 14:05
-
-
Save rsbohn/d0c7baeaad5fcf6bbbc9 to your computer and use it in GitHub Desktop.
Quick-n-dirty editor for browser localStorage
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
<div id='tag' contenteditable='true'>boot</div> | |
<textArea id='B'> | |
var Xput = function() { | |
localStorage[tag.textContent] = B.value; | |
} | |
var Xget = function() { | |
B.value = localStorage[tag.textContent]; | |
} | |
var Xopen = function(name) { | |
tag.textContent = name; | |
Xget(); | |
} | |
</textArea> | |
<script> | |
var B = document.getElementById('B'); | |
var tag = document.getElementById('tag'); | |
eval(B.value); | |
Xput(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment