Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
localStorage.clear() SCRIPT1002:语法错误 JsonSerializer.js,第 347 行字符 6
在 IE9 localStorage 中没有清除...
任何帮助表示赞赏!
我不肯定这是你的情况,如果你在离线模式下加载本地文件(即如果你将它作为file:///URL 加载),IE9 不支持本地存储。
file:///
但是我认为根本没有window.localStorage定义。试试这个:
window.localStorage
if(window.localStorage) { localStorage.clear() } else { alert("localStorage is not available"); }