document.execCommand("BackgroundImageCache",false,true)
2012-12-28 15:48
323 查看
IE6下的背景图片每次使用都会重新发送请求而不是使用本地缓存,特别是使用hover背景图片能明显感到到闪烁,有人用的办法解决了这个问题:
css方法:
html {filter:expression(document.execCommand("BackgroundImageCache", false, true));}
js方法:
window.isIE=navigator.appName.indexOf("Microsoft")==0;
if(isIE){
document.documentElement.addBehavior("#default#userdata");
document.execCommand("BackgroundImageCache",false,true);
}
但其实该bug是有条件的,即IE的cache设置为Every visit to the page,而不是默认的Automatically。基本上,只有开发者才会把cache设置为每次访问检查更新,所以这个bug其实不会影响真正的用户 (根据在winxp sp2的ie6下测试,虽然可能仍然调用了一次网络存取的api,但是并没有发生实际的请求,症状就是鼠标有极短时间的抖动,但是图像 不会闪烁。
css方法:
html {filter:expression(document.execCommand("BackgroundImageCache", false, true));}
js方法:
window.isIE=navigator.appName.indexOf("Microsoft")==0;
if(isIE){
document.documentElement.addBehavior("#default#userdata");
document.execCommand("BackgroundImageCache",false,true);
}
但其实该bug是有条件的,即IE的cache设置为Every visit to the page,而不是默认的Automatically。基本上,只有开发者才会把cache设置为每次访问检查更新,所以这个bug其实不会影响真正的用户 (根据在winxp sp2的ie6下测试,虽然可能仍然调用了一次网络存取的api,但是并没有发生实际的请求,症状就是鼠标有极短时间的抖动,但是图像 不会闪烁。
相关文章推荐
- IE6下背景图片不缓存问题或者document.execCommand("BackgroundImageCache",false,true)
- html{filter:expression(document.execCommand("BackgroundImageCache",false,true)
- document.execCommand("BackgroundImageCache", false, true)
- .document.execCommand("BackgroundImageCache",false,true)解决ie6下的背景图片缓存问题
- document.execCommand("BackgroundImageCache",false,true)解决ie6下的背景图片缓存问题
- IE图片缓存document.execCommand("BackgroundImageCache",false,true)
- IE6下背景图片不缓存问题或者document.execCommand("BackgroundImageCache",false,true)
- filter:expression(document.execCommand("BackgroundImageCache",false,true) 转
- ie6背景图片不缓存bug处理document.execCommand('BackgroundImageCache', false, true)
- document.execCommand("BackgroundImageCache",false)
- document.execCommand(”BackgroundImageCache”, false, true)
- document.execCommand(”BackgroundImageCache”, false, true)
- IE6下默认不缓存背景图片document.execCommand("BackgroundImageCache", false, true); "转载"
- window.document.execCommand("SaveAs",false,id+".xls"); 在IE7下的问题
- 打印:document.execCommand('print','true','true')的使用?
- proxy-target-class="true" 与proxy-target-class="false"的区别
- Ubuntu 中Codelite出现No executable file specified. Use the "file" or "exec-file" command
- proxy-target-class="true" 与proxy-target-class="false"的区别
- proxy-target-class="true" 与proxy-target-class="false"的区别
- label的Visible="False"时用alert(document.getElementById("aa").innerText);会报错,为什么呢?