Jineesh
Jineesh

Reputation: 11387

IE9 Localstorage API clear function issue

localStorage.clear() 
SCRIPT1002: Syntax error 
JsonSerializer.js, line 347 character 6

In IE9 localStorage is not clearing...

Any help appreciated!!

Upvotes: 0

Views: 854

Answers (1)

Matthew
Matthew

Reputation: 13332

I am not positive this is the case for you, IE9 does not support local storage if you are loading a local file in offline mode (ie if you are loading it as a file:/// URL).

But then I don't think window.localStorage is defined at all. Try this:

if(window.localStorage) {
  localStorage.clear() 
} else {
  alert("localStorage is not available");
}

Upvotes: 1

Related Questions