无法使用javascript在firefox上刷新
firefox中的缓存现在对我来说真的很痛苦,我知道这个问题已经被问了好几次了 但是真的没有其他方法允许无法使用javascript在firefox上刷新,javascript,firefox,Javascript,Firefox,firefox中的缓存现在对我来说真的很痛苦,我知道这个问题已经被问了好几次了 但是真的没有其他方法允许window.location.reload()在firefox中工作,在chrome中工作得非常完美 我已经尝试了在Google和stackoverflow上可以找到的所有方法,但是没有一种对我的案例有效 我尝试了以下方法: document.location.reload(true); window.href=window.href; window.location.href; 我还尝试
window.location.reload()代码>在firefox中工作,在chrome中工作得非常完美
我已经尝试了在Google和stackoverflow上可以找到的所有方法,但是没有一种对我的案例有效
我尝试了以下方法:
document.location.reload(true);
window.href=window.href;
window.location.href;
我还尝试为js文件分配不同的版本
我想看看是否有其他方法可以绕过这个问题
这就是我的js文件的样子
$(".drag").sortable({ // begin sortable
connectWith: ".drag",
receive: function(event, ui) { // begin receive
var id = $(ui.item).attr('id');
var status = this.id;
//alert(id);
$.ajax({ // begin ajax
url: "ajax/connectwith-multiple.ajax.php",
type: "GET",
data: {
'sales_card_id': id,
'status': status
}
}) // end ajax
//refresh page when ajax is completed
document.location.reload(true);
});
}, // end receive
}) // end sortable
这是我在上述评论的帮助下对上述问题的解决方案
$(".drag").sortable({ // begin sortable
connectWith: ".drag",
receive: function(event, ui) { // begin receive
var id = $(ui.item).attr('id');
var status = this.id;
//alert(id);
$.ajax({ // begin ajax
url: "ajax/connectwith-multiple.ajax.php",
type: "GET",
data: {
'sales_card_id': id,
'status': status
}
}) // end ajax
//refresh page when ajax is completed
.always(function() {
window.location.reload();
});
}, // end receive
}) // end sortable
我不理解缓存和用JS重新加载页面的问题之间的关系。我正在尝试使用“window.location.reload”来重新加载页面。它在chrome上运行得非常好,但在firefox上却不行。我在网上读到过,大多数人都说缓存可能有问题。window.location.reload(true)
应该可以,你想从服务器上重新加载什么?你是否检查了Network
面板,看它是否真的重新加载了?对不起complete()
被弃用了它被always()
替换了。你不应该在帖子中编辑已解决的代码来代替问题代码-这对未来的观众来说是无用的,因为他们不知道问题是从哪里开始的。如果你想为你的问题提供解决方案,你应该在回答中这样做。