if (localStorage)
{
var menushown = JSON.parse(localStorage.getItem("menuState"));
if (!menushown)
{
menushown = menuDefaultState;
}
}
else
{
menushown = menuDefaultState;
}
The above JavaScript fails in Opera 10.10. It complains that localStorage is undefined on the second line. This is true, but because of the check on the first line it should never reach the second line, and not fail. What am I doing wrong?