Skip to content

Instantly share code, notes, and snippets.

@kntajus
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kntajus/ebd6664a8794a2c64372 to your computer and use it in GitHub Desktop.
Save kntajus/ebd6664a8794a2c64372 to your computer and use it in GitHub Desktop.
Used to show broken localStorage in IE11
<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