![]() |
HTML5 / IE9 Local Storage
I run Windows 7 and IE9, and I believe IE9 supports HTML5 Local Storage. But when I run this offline (locally) in IE9
Code:
<script type="text/javascript">Chrome returns "Local Storage: Supported" My DOCTYPE is <!DOCTYPE html> Other tests also fail in IE. Example: Code:
localStorage.setItem("name", "Hello World!"); Any advice, please? Have I not configured IE9 properly? |
As far as I can see IE doesn't support localStorage for local files
See: http://stackoverflow.com/questions/8...rom-the-file-s |
Quote:
|
use userData persistence for up to 640kb of storage. not 5mb, but a lot better than 4-8kb!
use store(st_req_key, str_opt_val) to store things xbrowser using localStorage, globalStorage, userData, or cookies (fallbacks). Code:
<html><head> without a lib: Code:
<html><head> |
Thanks, this is a very helpful post!
|
IE 9 local file not from server
Doesn't seem work with IE9 when the htm file is located on a desktop hard drive and not on a server. Works fine with IE7 and IE8, when the file is on the hard drive.
|
If I may offer the following (works in IE7/8 on a server, not sure about 9):
Code:
var storage, fail, uid; |
In IE9 locally I get
Nope.. ain't happenin' :( |
IF you have access to a server that you can put the file on, you can make a file which you can run on the local hard drive with an iframe that points to the file on the server, it works fine in IE9, but you do need to be connected to the Internet, not offline.
Code:
<html> |
if you;re local in IE9, localStorage won't work. you have dom storage behaviors, and that's it. You can however read and write files by renaming the html file to .hta. I actually had an app that saved a json blob inside it's own hta file: to save it would load itself, split the file apart at the json section, sandwich in the new json stringification, and save the hta file over itself. A little different i realize, but it did the job i needed it too.
|
HTML 5 will be the new standard for HTML. HTML 5 is still a work in progress. However, the major browsers support many of the new HTML 5 elements and APIs.
|
Quote:
As best as I can determine, you seem to have one extra ')' character at the end of the definition for the script without a library. Code:
}()); |
fully formed and exported:
Code:
(function() {use: READ: store(key) WRITE: store(key, value) |
OK, I see the problem...
In post #4, it starts out as: Code:
<script type="text/javascript">Code:
(function() {I was getting an error with post #4 because of the extra ')'. Works fine with latest change. I assume problem had to do with the set-up at the start of post #4 where you did not use the initial '(' character. |
| All times are GMT +1. The time now is 02:35 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.