My JavaScript code contains an AJAX call within Datatables, and this snippet of code is causing an issue:
{ "data": null,
"width": "10%",
"render": function(data){
icon2 = '<center><button type="button" class="btn btn-info m-btn m-btn--icon m-btn--icon-only btn-sm" ' +
'data-toggle="m-tooltip" title="" onclick="sendEmail('+data.email+')" data-placement="top" data-original-title="' + 'Send Email' + ' "> <i class="la la-envelope"></i></button>';
icon2 += '</center>';
return icon2; }
}
In addition, I have a function defined as follows:
function sendEmail(email){
console.log("email: ", email);
}
However, upon clicking the button, I encounter the following error message: **Uncaught SyntaxError: missing ) after argument list**.
I am curious if there are any alternative solutions to resolve this issue.