我最近阅读了如何修复此问题并找到了解决方案,但我需要帮助应用该解决方案。
这是我的工作代码// This Has Flicker
$(function worker(){
// don't cache ajax or content won't be fresh
$.ajaxSetup ({
cache: false,
complete: function() {
// Schedule the next request when the current one's complete
setTimeout(worker, 2000);
}
});
var ajax_load = "";
// load() functions
var loadUrl = "https://test.com/updatedsales.php";
$(".result").html(ajax_load).load(loadUrl);
// end
});
这是反闪烁代码解决方案无法解决的问题在哪里?
if(json.status == "ACTIVE" && $('.result').html() !== "ACTIVE") {
$('.result').html(jason.status);
}
那么我在哪里提供上述解决方案呢?我很遗憾提出一个对JavaScript和jQuery专业人员来说似乎很容易的问题。这让我很沮丧,我真的需要你们的帮助。谢谢你读这个,詹姆斯。