Both statements window['localStorage']
and window.localStorage
are undefined when accessing the url "file:///C:/index.html"
Is localStorage off limits when running websites on the filesystem?
PS. I'm running the website on a Windows 7 phone hosting the website in isolatedStorage.
Yeah, IE9 doesn't support localStorage for local files. Not in any official documentation that I can find, but the same issue is described in this blog.
You'll have to either host the website externally, or find some other method of persisting data. [Support for HTML5-style local storage is still in beta in many browsers, anyway. Especially for pages on the local filesystem.]
You could try userdata behaviors, which is a pre-W3C solution developed by Microsoft for Internet Explorer. Not sure if it supports local filesystems, though. Links:
References: