IE8: "The system cannot find the path specified" error when acessing window.localStorage
I have some javascript code which accesses window.localStorage, and it's working fine on most machines, but in one of them (IE8 compat vie开发者_如何转开发w, Windows 7 64) I get the error "The system cannot find the path specified" whenever I try to read window.localStorage. I've tried to find some discussions about it at SO and Google (no cigar) and didn't find any suspicious setting at the browser's options. Has anyone encountered this error, and a solution for it? I could put a try/catch around window.localStorage but I'd rather understand what is going on.
Take a look at Which browsers support html5 offline storage.
According to that list IE8's supported. If it's only on one pc where you have the problem then check if there are plugins for that browser that might interfere.
IE8 supports local storage but IE7 and older do not. Since you're using compatibility view (for who knows what reason as only IE8+ have any market share to justify consideration for unless you're on a seriously outdated corporate LAN) you're basically working with IE 5.5's rendering engine.
Use object detection to tell the client, "No." because that is what you're going to find out ultimately be it decisively or not.
It sounds to me like the compat mode is to blame. Where I work there's this irritating company policy to support IE8, too. Whenever I run into a problem like this the quick fix is always to set the doctype to html5's <!DOCTYPE html>
, which kicks IE8 in to (almost) standards mode, and gives you access to all sorts of goodies (or in IE world: lesser evils) your denied in compat/quirks mode, including window.localStorage
Why do you expect the local storage to work in IE8? IIUC, not even IE9 will support local storage API.
We are talking about HTML5 local storage, right?
If it's only in this particular machine, it's very unlikely that your code is causing the problem. It could be a software installation issue.
As far as i know there is no difference in using localstorage for a 32b or 64b browser.
One thing i don't get is the machine with a problem is a W7 64bit system. So it should have IE9. Looking at your explanation it IE runs in IE8 comp mode. Why??
Things you can look at or do:
- Browser modus and document modus if the later is quirks change it it ie8.
- Use native ie9 not comp mode.
- Use IE with admin rights.
- Disable view intranet sites in Compatibility View
- Check your AntiVirus, and logs.
Install FF or Chrome on this machine if it has the same issue on this machine there is something wrong with the machine
Good Luck, let us know if you solved it and of course how.
精彩评论