How to pass a Jquery plugin as a parameter to the On event

0

I use the Datatables plugin, and in the table there will be the option to edit and delete, I want to show a confirmation if the user clicks delete. So I'll use the "confirm" plugin, however, this plugin is only valid for the first page of DataTable, in the other pages or when I do a search it does not work. I thought of the "on" event, but how do I pass the "confirm" plugin instead of the (3rd parameter) function.

Something like:

$("html").on("click", ".confirm", $.confirm());
    
asked by anonymous 17.02.2015 / 18:36

1 answer

2

You can pass a function that calls $.confirm . For example:

$("#elemento").on("click", function() {
    $.confirm();
});
    
17.02.2015 / 18:53