Can be done with a code:
Copy Code code as follows:
Document.execcommand ("Backgroundimagecache", false, true);
Of course, in order to other browsers can normally pass, need to make a decision after the call, is more secure:
Copy Code code as follows:
if (BROWSER.ISIE6) {
try{
Document.execcommand ("Backgroundimagecache", false, true);
}
catch (E1) {}
}
Platform detection code can be written in this way, excerpted from ext Source:
Copy Code code as follows:
var Browser = {};
try{
(function () {
var idseed = 0,
UA = Navigator.userAgent.toLowerCase (),
Check = function (r) {
Return R.test (UA);
},
DOC = document,
Isstrict = Doc.compatmode = = "Css1compat",
Isopera = Check (/opera/),
Ischrome = Check (/\bchrome\b/),
Iswebkit = Check (/webkit/),
Issafari =!ischrome && Check (/safari/),
IsSafari2 = Issafari && Check (/applewebkit\/4/),//unique to Safari 2
IsSafari3 = Issafari && Check (/version\/3/),
IsSafari4 = Issafari && Check (/version\/4/),
Isie =!isopera && Check (/msie/),
isIE7 = Isie && check (/msie 7/),
isIE8 = Isie && check (/msie 8/),
isIE6 = Isie &&!isie7 &&!isie8,
Isgecko =!iswebkit && Check (/gecko/),
IsGecko2 = Isgecko && Check (/rv:1\.8/),
IsGecko3 = Isgecko && Check (/rv:1\.9/),
Isborderbox = Isie &&!isstrict,
iswindows = Check (/windows|win32/),
Ismac = Check (/macintosh|mac os x/),
Isair = Check (/adobeair/),
Islinux = Check (/linux/),
Isipad = Check (/ipad/),
Issecure =/^https/i.test (Window.location.protocol);
Extend (browser,{
Isopera:isopera,
Isie:isie,
Isie6:isie6,
Isfirefox:isgecko,
Issafari:issafari,
Ischrome:ischrome,
Isipad:isipad
});
})();
}catch (e) {}
The Extend method is easy, too.
Copy Code code as follows:
function Extend (OBJ1,OBJ2) {
for (Var o in obj2) {
Obj1[o] = Obj2[o];
}
return obj1;
}