我们有两页"/ read"和"/ write".页面"/ write"每秒用当前时间更新localStorage:
setInterval(function(){
var time = (new Date()).getTime();
localStorage.setItem("time", time);
console.log("set", time);
},1000);
Run Code Online (Sandbox Code Playgroud)
页面"/ read"读取相同的存储空间:
setInterval(function(){
var time = localStorage.getItem("time");
console.log("get", time);
},1000);
Run Code Online (Sandbox Code Playgroud)
有人会认为"/ read"页面应该显示由另一个页面写入localStorage的相同值.但是在Win8.1的IE11中,这已经破了.页面"/ read"从存储中读取一些旧值,并在其上显示相同的值(就像它使用缓存进行本地存储一样).有任何想法吗?
javascript html5 internet-explorer local-storage internet-explorer-11
QMAKE_CXXFLAGS在编译 .cpp 文件时应用,但不适用于 .mm 文件。我应该使用哪个标志?