gpt4 book ai didi

javascript - SwfUpload: prevent_swf_caching 在除 IE 以外的其他浏览器中?

转载 作者:行者123 更新时间:2023-11-30 06:54:39 24 4
gpt4 key购买 nike

我正在使用 SwfUpload,在一个页面速度优化项目中,我注意到在默认设置中 swfupload 通过附加一个随机查询字符串来阻止加载 swfupload.swf。

这是因为从缓存中获取 swf 时出现 IE 错误。

但是我真的很想缓存这个文件。 :(

对于至少不缓存 IE 以外的其他浏览器,这是一个可接受的工作范围吗:

prevent_swf_caching:!!$.browser.msie,

最佳答案

相关代码是:

if (!!this.settings.prevent_swf_caching) {
this.settings.flash_url = this.settings.flash_url + (this.settings.flash_url.indexOf("?") < 0 ? "?" : "&") + "preventswfcaching=" + new Date().getTime();
}

/*snip*/
this.ensureDefault("prevent_swf_caching", true);

所以,你在初始化的时候,只要把用户设置传过去就可以了

{"prevent_swf_caching": !$.browser.msie }

关于javascript - SwfUpload: prevent_swf_caching 在除 IE 以外的其他浏览器中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7442191/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com