Correctly Suppressing Warnings in DataTables?

前端 未结 6 2224
小蘑菇
小蘑菇 2020-12-24 12:13

I\'m trying to correctly suppress warnings (alerts) in DataTables. The standard behavior of DataTables is to throw a javascript alert when an error occurs; however, this is

6条回答
  •  春和景丽
    2020-12-24 12:48

    try this:

    $.fn.DataTable.ext.oApi._fnLog = function (settings, level, msg, tn) {
        msg = 'DataTables warning: ' +
                (settings !== null ? 'table id=' + settings.sTableId + ' - ' : '') + msg;
    
        if (tn) {
            msg += '. For more information about this error, please see ' +
                    'http://datatables.net/tn/' + tn;
        }
        console.log( msg );
    };
    

提交回复
热议问题