Javascript Firefox$(“元素”).LoadjQuery显示旧的img
我对firefox有特殊的问题。当我更改页面时,我调用LoadjQuery函数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
$("#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);
}
});
}