I am creating a completely offline HTML5 app using localStorage.
I have successfully saved and retrieved and manipulated localStorage data in a single .HTML file. Anyhow, now when I am trying to access localSotrage data stored by one .HTML file on another .HTML file, I am getting no success.
Anyhow, I have created a separate .html file to clear all the localStorage, and that one is working fine.
Is it because localStorage of each web page is separate and cannot be put together or some other error?
localStorage is controlled by same-origin policy Assuming you're using
file://
it varies by browser:Webkit:
All
file://
documents have the same origin https://bugs.webkit.org/show_bug.cgi?id=20701Mozilla:
https://developer.mozilla.org/en-US/docs/Same-origin_policy_for_file:_URIs
IE:
Doesnt apply (see: localStorage object is undefined in IE)