0
我有多個數據表,他們都有自己的ID。 現在這是沒有問題的,我遇到的問題是,我的代碼似乎能夠完美地輸出我的console.log()
調用,但在我的網絡選項卡我沒有看到我的ajax調用?jQuery DataTables Ajax調用不起作用
我使用下面的jQuery代碼:
function DtAjax(type) {
console.log("Type: "+type);
if($('#data-table_' + type + '_wrapper').children().length == 0){
console.log("True");
$('#data-table_' + type).DataTable({
"ajax": "<?php echo base_url('admin/emails/ajax/get'); ?>" + "/" + type
});
console.log("End function");
}
}
$(document).ready(function(){
DtAjax(1);
$("li .changeContent").on('click', function (event) {
event.preventDefault(); // Prevents going to a different URL
// Content change
$(".mailContent").hide('drop', 500).removeClass("active_div");
$("." + $(this).attr('data-open')).delay(500).show('drop', 500).addClass("active_div");
// button set new active
$("#icon_nav_h > li.active").removeClass('active');
$(this).parent().addClass('active');
});
});
它記錄一切DtAjax函數內,任何(明顯)原因,我無法找到我的網絡標籤Ajax調用?
1個最佳答案 –