我对IE 10有点头疼。(谁不呢)
我有这个上传功能,用户可以上传某些文件(PDF)到一个网站的管理部分。
上传完成后,我使用jQuery通过jQuery.post操作显示dir的内容,实际上是重新加载dir内容并将其打印到屏幕上。
我所有的其他浏览器(经过测试的Opera,Chrome,Firefox)一切都很好。但是在IE10中,打印到屏幕上的目录的内容似乎是缓存的版本。通过使用FTP程序,我可以验证文件实际上是用IE10上传的,但是它不会读取更新的内容。我必须重新启动IE10浏览器,以便它能够正确地重新加载。
对于如何迫使IE10从零开始读取内容,或者其他解决方案,有什么想法吗?
重装码
<table>
<?php
$dir_handle = opendir("../../images/certificates");
while (($entry = readdir($dir_handle)) !== false){
// Only show PDF's
$filetest = preg_match('/(.pdf|.PDF)$/',$entry);
if ($filetest){
echo "<tr>";
echo "<td rel='{$entry}'><img class='pdfdownloadicon imageIcon' src='images/pdfdownload.png' />{$entry}</td>";
echo "</tr>";
}
}
$typeOfFileShow = "document";
?>
执行上述代码的脚本
function showFileBrowser(path) {
currentTypeOfFileShow = path;
$("#fileselectbox").load("includes/filebrowser."+path+".inc.php");
$("#filebrowser").slideDown('fast');
}发布于 2013-08-26 10:09:39
通过jQuery.post操作
.load('...')使用一个GET请求,除非您给它一个对象作为第二个参数。
使用空对象作为第二个参数发送未缓存的POST请求
$("#fileselectbox").load("includes/filebrowser."+path+".inc.php", {});或将cache: false设置为默认设置
$.ajaxSetup({
cache: false
});发布于 2013-08-26 10:11:39
您是否尝试过使用rand号码来欺骗缓存?
例如
function showFileBrowser(path) {
var rand = Math.floor(Math.random()*11);
currentTypeOfFileShow = path;
$("#fileselectbox").load("includes/filebrowser."+path+".inc.php&r="+randomnumber);
$("#filebrowser").slideDown('fast');
}https://stackoverflow.com/questions/18441374
复制相似问题