I am dynamically creating a string using javascript, here is the code below:
var row2 = "<tr><td><a href='#editModal' class='modal_trigger' data-info="+name+" data-toggle='modal'>Edit</a></td></tr>";
Here var is a JSON object. This is later transmitted modally when the user clicks on it, and values can be obtained. However, just announcing varhow I did the above sets data-info=[Object object].
The contents of the JSON variable:
Object
name: "Test 8"
created_at: "2015-06-10 16:54:45"
id: 128
updated_at: "2015-06-10 16:54:45"
__proto__: Object
Is there any way?
source
share