IE中未定义localStorage对象 [英] localStorage object is undefined in IE
本文介绍了IE中未定义localStorage对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在我的JS应用程序中使用localStorage,我想知道为什么IE9声称 localStorage == undefined
。据我所知,IE8支持它,有没有办法让它在新版本中运行?
I'm using localStorage in my JS application and I was wondering why IE9 claims localStorage == undefined
. As far as I know, IE8 supports it, is here any way to get it working in the new version?
推荐答案
你是吗?在本地HTML文件上测试它?即 file:///
URL?
Are you testing this on a local HTML file? i.e. a file:///
URL?
localStorage仅适用于HTTP网站。这在IE9 Dev Preview中没有改变。
localStorage is only available on HTTP websites. That hasn't changed in IE9 Dev Preview.
这篇关于IE中未定义localStorage对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文