IE的cache设置为Every visit to the page,而不是默认的Automatically。IE6下设置背景图片是不会被真正cache住的.但一般只有开发者才会把cache设置为每次访问检查更新,所以这个bug不会影响到真正的用户。
--------------------------------------------------
<body onload="document.execCommand('BackgroundImageCache',false,true)">
上面是网页版QQ http://qun.qq.com/air/ 的代码
-------------------------------------------------
var isIE = ua.indexOf("msie") > -1, isIE7 = ua.indexOf("msie 7") > -1;
// remove css image flicker
if(isIE && !isIE7){
try{
document.execCommand("BackgroundImageCache", false, true);
}catch(e){}
}
上面是EXT的实现
本文解析了Internet Explorer中一个特定的缓存问题:当浏览器设置为每次访问页面时检查更新,背景图片将不会被正确缓存。文中提供了两种解决方法,一种是通过网页代码直接设置,另一种是在JavaScript中判断是否为IE且非IE7的情况下执行背景图片缓存命令。
255

被折叠的 条评论
为什么被折叠?



