我想在.load()之前顯示「LoaderMain」div,並且完全隱藏「LoaderMain」。當我取消註釋我的表演/隱藏時,它永遠不會顯示。在Ajax中顯示/隱藏Div。()
$('#content').html('');
//$('#LoaderMain').show();
$("#content").load(url, function(response, status, xhr) {
if (status == "error") {
var msg = "Sorry but there was an error: ";
$("#content").html(msg + xhr.status + " " + xhr.statusText);
}
});
//$('#LoaderMain').hide();
你必須在回調中隱藏它。 – Barmar