Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/404.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Firefox$(“元素”).LoadjQuery显示旧的img_Javascript_Jquery_Firefox - Fatal编程技术网

Javascript Firefox$(“元素”).LoadjQuery显示旧的img

Javascript Firefox$(“元素”).LoadjQuery显示旧的img,javascript,jquery,firefox,Javascript,Jquery,Firefox,我对firefox有特殊的问题。当我更改页面时,我调用LoadjQuery函数 $("#all").load("test.php", function() { testFunction(); //this function will call Restfull-API, get some }); function ajaxRequestGetAllianceInfo() { $.ajax({ type: "GET", dataType: "j

我对firefox有特殊的问题。当我更改页面时,我调用LoadjQuery函数

$("#all").load("test.php", function() {

    testFunction(); //this function will call Restfull-API, get some 
});
function ajaxRequestGetAllianceInfo() {
    $.ajax({
        type: "GET",
        dataType: "json",
        url: "./ajax_request/test.php",
        data: {}, 
        error: function(jqXHR, textStatus, errorThrown) {
            alert(textStatus + ": " + errorThrown);
        },

        success: function(data){

            drawTestPage(data);

        }

    });
}
这是test.php:

<div class="pageContent">

    <div class="testPage">

        <div id="link">
        </div>

        <div id="imageDiv">
            <img id="image"/>
        </div>

        <div id="middleContent">

            <div id="test">
            </div>

            <div id="info">
            </div>

        </div>

        <div id="link_bottom">
        </div>

    </div>

</div>
function ajaxRequestGetAllianceInfo() {
    $.ajax({
        type: "GET",
        dataType: "json",
        url: "./ajax_request/test.php",
        data: {}, 
        error: function(jqXHR, textStatus, errorThrown) {
            alert(textStatus + ": " + errorThrown);
        },

        success: function(data){

            drawTestPage(data);

        }

    });
}
最后,我们有了在加载页面中更改图像src的功能:

function ajaxRequestGetAllianceInfo() {
    $.ajax({
        type: "GET",
        dataType: "json",
        url: "./ajax_request/test.php",
        data: {}, 
        error: function(jqXHR, textStatus, errorThrown) {
            alert(textStatus + ": " + errorThrown);
        },

        success: function(data){

            drawTestPage(data);

        }

    });
}
看看我得到了什么:,第一个图像不存在于inspect元素中。
function ajaxRequestGetAllianceInfo() {
    $.ajax({
        type: "GET",
        dataType: "json",
        url: "./ajax_request/test.php",
        data: {}, 
        error: function(jqXHR, textStatus, errorThrown) {
            alert(textStatus + ": " + errorThrown);
        },

        success: function(data){

            drawTestPage(data);

        }

    });
}
如果我点击右侧:或在firefox中更改tab,当我返回到我的tab top图像不存在时,这是正确的,因为我需要在chrome上只有一个图像,这是正确的。我不知道firefox为什么缓存这个旧的加载html数据。知道如何解决这个问题吗?对于某些页面,我在其他页面上遇到这个问题,一切正常

function ajaxRequestGetAllianceInfo() {
    $.ajax({
        type: "GET",
        dataType: "json",
        url: "./ajax_request/test.php",
        data: {}, 
        error: function(jqXHR, textStatus, errorThrown) {
            alert(textStatus + ": " + errorThrown);
        },

        success: function(data){

            drawTestPage(data);

        }

    });
}

注意:这没有帮助

我使用$html.focus:D解决方案

function ajaxRequestGetAllianceInfo() {
    $.ajax({
        type: "GET",
        dataType: "json",
        url: "./ajax_request/test.php",
        data: {}, 
        error: function(jqXHR, textStatus, errorThrown) {
            alert(textStatus + ": " + errorThrown);
        },

        success: function(data){

            drawTestPage(data);

        }

    });
}
顺便说一句,你们都是给我负面评价的白痴,

可能的重复也无济于事
function ajaxRequestGetAllianceInfo() {
    $.ajax({
        type: "GET",
        dataType: "json",
        url: "./ajax_request/test.php",
        data: {}, 
        error: function(jqXHR, textStatus, errorThrown) {
            alert(textStatus + ": " + errorThrown);
        },

        success: function(data){

            drawTestPage(data);

        }

    });
}