0
我jQuery中有這個功能,它使用.load打開一個彈出的div在頁面上同步的XMLHttpRequest:JQuery的錯誤 - 主線程
function LoadModal(page, title) {
title = title || '';
$("#modal_page").fadeIn("slow");
$("#modal_title").html(title);
$("#modal_page_body").html('<h2 align="center">Loading...</h3><p align="center"><i class="fa fa-refresh fa-spin fa-5x"></i></p>'); //$('#LoadingDiv').show();
$("#modal_page_body").load(page, function(){
});
$("html, body").animate({ scrollTop: 0 }, "slow");
}
當我調用這個函數,我的控制檯顯示此錯誤:
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.
不,還是一樣的警告信息 – charlie
什麼是頁面url? json或其他? –
好的,請嘗試我的更新 –