![](/img/trans.png)
[英]Testing JavaScript With Firefox - refresh does not seem to always refresh JavaScript
[英]unable to refresh on firefox with javascript
目前,firefox中的緩存確實讓我很痛苦,我知道這個問題已經問了好幾次了。
但是,實際上沒有其他方法允許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
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.