Good evening, I'm trying to send an encoded JSON via the onclick
attribute.
Unfortunately this JSON contains articulated strings with many apostrophes and quotes. As you can well understand the JSON closes the quotes of the onclick
attribute.
Edit 1
This is in a "return" of jquery DataTables loaded by ajax and the json is obviously different for item so i can't make an addEventListener (correct me if I'm wrong).
i need this getJsonObj()
function to open a modal with all information inside
{data: null,
render: function (data, type) {
const json = JSON.stringify(data);
console.log(json);
return `<a onclick="event.preventDefault();getJsonObj(${json})"style='cursor: pointer' id='modalApp' class='orange-link uk-text-bold uk-text-uppercase'>${data.full_name}</a>`;
},
}
This is the output:
Any ideas to be able to send it without problems?
Edit 2
Im not using any framework, only javascript, jquery, and Jquery datatables