我想在我的项目中使用Datatables.我想了解使用"fnServerData"回调选项.我已经浏览了这里的文档,并看到了以下示例代码 -
$(document).ready( function() {
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "xhr.php",
"fnServerData": function ( sSource, aoData, fnCallback, oSettings ) {
oSettings.jqXHR = $.ajax( {
"dataType": 'json',
"type": "POST",
"url": sSource,
"data": aoData,
"success": fnCallback
} );
}
} );
} );
Run Code Online (Sandbox Code Playgroud)
什么是"sSource","aoData"参数以及我们如何在其中提供价值?另外,我们可以提交一个动态获取JSON数据的表单,而不是将JSP或PHP作为源(sAjaxSource)吗?