i have a div area in which i added some json input from an ajax success function.
function rowClicked(term){
$.ajax({
url: "/student/transcript_detail",
data:{term:term},
on:"/student/transcript_detail",
method:"POST",
success: function(responseJson) {
$('#course-brief-row').empty();
$('#nomre_term_body').empty();
$.each(responseJson, function(index,termDetail){
$("#course-brief-row").append("<a class='style-item' onclick='courseClicked(${termDetail.coirseId},${term})'>" +termDetail.coursename+"<br>"+
termDetail.grade+"<br>"+
termDetail.stat+"<br>"+
"<p><br> </p>"+
"</a>");""
});
},
error: function () {
alert("ERROR");
}
});
then i want each added <a>
tag, to send my json parameter as an input for their onclick
function calling,
function courseClicked(coid,term){
//do sth
}
now i want to know how should i send this argumats? In other words how should i write this part:
onclick='courseClicked(${termDetail.coirseId},${term})