我正在使用 JQuery SAjaxsource 如何在 SAjaxsource 完成后调用 javascript 函数。我想在数据表加载完成后更新一个div。请帮助我......
Edit:
$(document).ready( function() {
var oTable = $('#example').dataTable( {
"bServerSide": true,
"sSearch":false,
"aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]],
"bPaginate": true,
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"sAjaxSource": "server_processingCDB1.php"
} );
查看帮助的回调部分中的 fnServerData 选项 ->http://www.datatables.net/usage/callbacks http://www.datatables.net/usage/callbacks
为您提供所需的一切...这里有一些示例代码:
$(document).ready(function() {
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "../examples_support/server_processing.php",
"fnServerData": function ( sSource, aoData, fnCallback ) {
$.getJSON( sSource, aoData, function (json) {
/* Do whatever additional processing you want on the callback, then tell DataTables */
fnCallback(json)
} );
}
} );
} );
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)