Skip to content

Instantly share code, notes, and snippets.

@Kntajus Kntajus/LocalStorage
Last active Aug 29, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.