I am parsing a JSON object and want to make each object as a link and having them be able to call a function when clicked. I then append each of my objects to an unordered list. However, I am getting a syntax error in my code, but I think that the string is built properly. The error states JAVASCRIPT ERROR(unknown source) expected ')'
Any help would be appreciated, thank you!
var string = "<a onclick=AppendDescription(" + obj[i].Name + ")>" + obj[i].Name + "</a>";
//This is what the string looks like after I build it. "<a onclick=AppendDescription(Test 1)>Test 1</a>"
$("#textbox ul").append("<li>"
+ string //error occurs here
+ "</li>");