i am getting json file data on ready event
$(document).ready(function(e){
$.getJSON( "data/wall.json", function( data ) {
createWall(data);
});
})
function createWall(data)
{
for(var i=0; i<data.length;i++){
var stats = $("<p class='meta'><span>14 Days Ago</span><span class='comments' onclick='commentSection("+data[i]+")'>0 Comments</span><span class='likes'>Like</span></p>");
$('#wall').append(stats);
}
}
function commentSection(data){
console.log(data);
}
Here when i click on comments. It shows Unexpected identifier . How to pass particular data by onclick event