I am trying to render an anchor with json2html with the following transform:
'renderTimeline':[ {
tag: "a",
class: "btn btn-warning btn-circle",
style: "float: right;",
html: "<i class=\"icon-remove\"></i>",
"href": function() {
var myhref = "javascript:delSchedule(" + this + ");";
return myhref;
}
}]
intention is to delete the json object,which is passed to it with :
$('#sunTimeLine').json2html(sched1.sunday, transforms.renderTimeline, {'events':true});
I get the following as o/p on the rendered html:
<a class="btn btn-warning btn-circle" style="float: right;" href="javascript:delSchedule([object Object]);"><i class="icon-remove"></i></a>
when i click on the link(button) i get a message in browser console:
SyntaxError: missing ] after element list
Please help me solve this issue.