Last active
August 29, 2015 14:04
-
-
Save kntajus/ebd6664a8794a2c64372 to your computer and use it in GitHub Desktop.
Used to show broken localStorage in IE11
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
<html> | |
<head> | |
<title>LocalStorage fundamentally broken in IE11</title> | |
</head> | |
<body> | |
String length: <input id="length" type="text" value="2000" /><br /> | |
<button onclick="set(null);">Clear</button> | |
<button onclick="store('A');">Store w/ A</button> | |
<button onclick="store('B');">Store w/ B</button> | |
<button onclick="show();">Show value</button> | |
<div id="output"></div> | |
<script> | |
function set(value) { | |
localStorage.setItem('stuff', value); | |
}; | |
function store(prefix) | |
{ | |
var length = parseInt(document.getElementById('length').value); | |
var value = prefix + new Array(length).join('a'); | |
set(value); | |
}; | |
function show() { | |
document.getElementById('output').textContent = localStorage.getItem('stuff'); | |
}; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment