I have this variable injavascript
var ACTIONS =
"<div class='btn-group' role='group'>" +
"<a class='btn btn-xs btn-primary' href='/users/show/edit/" + row.id + "'>Edit</a>"+
"<a class='btn btn-xs btn-success' href='/users/show/read/" + row.id + "'>Show</a>"+
"<a class='btn btn-xs btn-danger' onclick='destroyUser('" + row.name + "');' >Delete</a>"+ // <-- Mi problema es aquí
"</div>";
When the document finishes loading when inspecting the element it shows me like this:
It should show me like this:onclick="destroyUser('jhon doe');"
How can I correct this?
You can replace the current quotes with doubles in the attribute value and "escape" those quotes: