i wanna pass a json result parameter to a twig format in file "A.js.twig" as follow:
$.ajax({
type: 'POST',
url: "managemore",
success: function(msg){
var ret = $.parseJSON(msg)
var str = '';
for (var i=0; i<ret.deliverLength; i++)
{
str = str + "<a href=\" {{ path('changeJob', {'jid':ret.deliver[i]['jid']}) }} \", target=\"_self\" ><li>hello</li></a>";
}
},
error: function(XmlHttpRequest,textStatus, errorThrown){
alert("fail");
}
});
it went wrong...so how can i pass the ret.deliver[i]["jid"] in the twig format in the right way? Thanks a lot.