Javascript 禁用Internet Explorer 8的jQuery中的缓存问题

Javascript 禁用Internet Explorer 8的jQuery中的缓存问题,javascript,jquery,Javascript,Jquery,我无法查看新的搜索结果,因为它们已在数据库中更新。仅使用Internet Explorer 8。我试着刷新页面,但没有效果。Chrome和Firefox运行良好 我可以通过选择“检查存储页面的新版本:每次访问网页时”临时解决此问题。然而,当我将其投入生产时,这意味着它将不适用于使用IE 8 9或10的最终用户 任何有用的提示都将不胜感激。提前谢谢 以下是我已经尝试过的: <script> type=“text/javascript" src="js/jquery-1.9.1.min.

我无法查看新的搜索结果,因为它们已在数据库中更新。仅使用Internet Explorer 8。我试着刷新页面,但没有效果。Chrome和Firefox运行良好

我可以通过选择“检查存储页面的新版本:每次访问网页时”临时解决此问题。然而,当我将其投入生产时,这意味着它将不适用于使用IE 8 9或10的最终用户

任何有用的提示都将不胜感激。提前谢谢

以下是我已经尝试过的:

<script> type=“text/javascript" src="js/jquery-1.9.1.min.js?new=yes"></script>

$(document).ready(function () {
    //http://stackoverflow.com/questions/217957/how-to-print-debug-messages-in-the-google-chrome-javascript-console/2757552#2757552
    if (!window.console) console = {};
    console.log = console.log || function () {};
    console.dir = console.dir || function () {};

    //listen for keyup on the field

    $("#searchField").keyup(function () {
        //get and trim the value
        var field = $(this).val();

        field = $.trim(field)

        //if blank, nuke results and leave early

        if (field == "") {
            $("#results").html("");

            return;
        }

        console.log("searching for " + field);

        $.getJSON("cfc/test.cfc?returnformat=json&method=search", {
            "search": field
        }, function (res, code) {

            var s = "<table width='1000' class='gridtable' name='table1' border='1'><tr><th width='40'>Attuid</th><th width='80'>Device</th><th width='55'>Region</th><th width='140'>Problem</th><th width='160'>Description</th><th width='120'>Resolution</th> <th width='180'>Resolution Description</th><th width='40'>Agent</th><th width='140'>Timestamp</th></tr>";

            s += "";

            for (var i = 0; i < res.table_demo.length; i++) {
                s += "<tr><td width='42'>" + res.table_demo[i].pa_uid +
                    "</td><td width='80'>" + res.table_demo[i].pa_device +
                    "</td><td width='55'>" + res.table_demo[i].pa_region +
                    "</td><td width='140'> " + res.table_demo[i].pa_problem +
                    "</td><td width='160'> " + res.table_demo[i].pa_description +
                    "</td><td width='120'>" + res.table_demo[i].pa_resolution +
                    "</td><td width='180'>" + res.table_demo[i].pa_rdescription +
                    "</td><td width='42'> " + res.table_demo[i].pa_agent +
                    "</td><td width='140'> TimeStamp"
                "</td>";

                s += "</tr>";
            }

            s += "</table>";

            $("#results").html(s);
        });
    });
})
type=“text/javascript”src=“js/jquery-1.9.1.min.js?new=yes”>
$(文档).ready(函数(){
//http://stackoverflow.com/questions/217957/how-to-print-debug-messages-in-the-google-chrome-javascript-console/2757552#2757552
如果(!window.console)console={};
console.log=console.log | |函数(){};
console.dir=console.dir | |函数(){};
//在球场上倾听凯普的声音
$(“#搜索字段”).keyup(函数(){
//获取并修剪值
var字段=$(this.val();
字段=$.trim(字段)
//如果为空,则显示nuke结果并提前离开
如果(字段==“”){
$(“#结果”).html(“”);
返回;
}
console.log(“搜索”+字段);
$.getJSON(“cfc/test.cfc?returnformat=json&method=search”{
“搜索”:字段
},函数(res,code){
var s=“attuiddeviceregionproblemdescription解析DescriptionAgentTimestamp”;
s+=”;
对于(变量i=0;i
尝试
$.ajaxSetup({cache:false});
因此禁用jQuery缓存

此外,若要立即使页面过期,请尝试添加元标记:

<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Expires" content="-1" />


通过ajaxSetup禁用缓存,或者改用$.ajax禁用缓存(首选)。您查看过HTTP缓存头吗?这可能只是一个剪切粘贴错误,但看起来不正确:
type=“text/javascript”src=“js/jquery-1.9.1.min.js?new=yes”>