我在使用 ajax 加載數據時遇到問題,我使用 async false 是因為我希望我的 ajax 進程首先運行。如果它不使用 async false 顯示和數據將被堆疊。如何在ajax async false中顯示我的加載程序?我想添加我的裝載機。這是我的裝載機$("#loading").show();這是我更改時的選擇事件$('#boothFill').on('change', function () { if ($.fn.DataTable.isDataTable('#tbltransaction')) { $('#tbltransaction').DataTable().destroy(); } $('#areaFill').find('.optArea').remove(); $('#acamFill').find('.optAcam').remove(); if ($("#boothFill").val() != "all") { $('#statisticData').find('.removeCardStat').remove(); ajaxCardStatistic($('#dateStartTanggal').val(), $('#dateEndTanggal').val(), $('#areaFill').val(), $('#boothFill').val(), $('#acamFill').val(), $("#productFill").val()); }else{ $('#statisticData').find('.removeCardStat').remove(); } ajaxArea($('#boothFill').val(), $('#acamFill').val()); ajaxAcam($('#areaFill').val(), $('#boothFill').val()); ajaxGet($('#dateStartTanggal').val(), $('#dateEndTanggal').val(), $('#areaFill').val(), $('#boothFill').val(), $('#acamFill').val(), $("#productFill").val(), $("#productTypeFill").val()); getAllData($('#dateStartTanggal').val(), $('#dateEndTanggal').val(), $('#areaFill').val(), $('#boothFill').val(), $('#acamFill').val());});這是選擇更改時調用的函數function ajaxCardStatistic(dateStartTanggal, dateEndTanggal, area, booth, acam, product){ $.ajax({ type: "POST", url: "dashboard/statisticCard", data: { dateStart : dateStartTanggal, dateEnd : dateEndTanggal, area : area, booth : booth, acam : acam, product : product, }, } });}
- 2 回答
- 0 關注
- 160 瀏覽
添加回答
舉報
0/150
提交
取消