When I tried to get item from the local storage value , it returns "undefined" in IE8
I'm using the following codes for :
Set item :
var value = document.getElementById('test').value;
var key = "i" + x + "test" + y;
localStorage[key] = value;
And get Item:
var test = localStorage["i" + x + "test" + y];
alert(test);
It return undefined
I followed the same code for firefox开发者_开发技巧 4 and chrome .. it returns the same value which i have set in the local storage
Ensure you are using the proper HTML5 Doctype:
<!DOCTYPE html>
and that you are in IE8 mode (ensure you haven't enabled some compatibility IE7 mode).
精彩评论