0

I am unable to view new search results as they are updated in the database. Only using Internet Explorer 8. I tried refreshing the page but that does nothing. Chrome and Firefox work fine.

I am able to temporarily resolve this issue by choosing "Check for new versions of the stored page : Every time I visit the webpage". However, as I move this into production this means it won't work for end users using IE 8 9 or 10.

Any helpful tips are appreciated. Thanks in Advance.

Here is what I have already tried:

<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);
        });
    });
})
4

1 回答 1

1

Try $.ajaxSetup({ cache: false }); so disable jQuery caching.

Also to expire pages instantly, try adding meta tags:

<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Expires" content="-1" />
于 2013-11-04T16:08:08.137 回答