Wrong arguments to window.onerror when using dataTables 1.10.19 (and 1.10.20)

Wrong arguments to window.onerror when using dataTables 1.10.19 (and 1.10.20)

davispuhdavispuh Posts: 1Questions: 1Answers: 0

See example here: https://jsfiddle.net/z81kdfjv/1/

But basically

$('#test').DataTable({
          processing: true,
          serverSide: true,
          ajax: "?test",
        });

window.onerror = function(message, source, lineno, colno, error) {
    console.log("message: " + message);
    console.log("source: " + source);
    console.log("lineno: " + lineno);
}

In console there will be

message: [object Object]
source: [object Object]
lineno: 7

_fnLog( oSettings, 0, 'Ajax error', 7 ) will call _fnCallbackFire( settings, null, 'error', [ settings, tn, msg ] );
Which will cause $(settings.nTable).trigger( e, args ); to be called with these args.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin
    Answer ✓

    Thank you for this. I'll look into that for the next patch release of DataTables.

    Allan

  • allanallan Posts: 61,744Questions: 1Answers: 10,111 Site admin

    I've just been looking into and I've not actually managed to recreate the error with the linked test case - the window.onerror doesn't get triggered at all - which is what I would expect here, the alert is shown instead. Is there something else that needs to be done?

    Allan

This discussion has been closed.