Uncaught error thrown when using alert() inside button action

Uncaught error thrown when using alert() inside button action

mscdexmscdex Posts: 6Questions: 3Answers: 0

Link to test case: https://jsbin.com/tunoguwiyu/edit
Debugger code (debug.datatables.net): ehiyuf
Error messages shown: r.slice is not a function / n.slice is not a function
Description of problem: Using a custom button with an action that calls alert() will cause an uncaught error to be thrown outside of the action function itself. Explicitly setting async in the button config and setting it to a value > 0 causes the error not be thrown.

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    edited March 28

    That's a good one! It looks like it boils down to something in jQuery - I created this isolated test case. It is the alert() that seems to be causing the issue - putting in any other code in there, like a console.log, allows it to work.

    I've opened this issue to see if the jQuery folks have any idea.

    Allan

Sign In or Register to comment.