I'm using webuiPopover plugin, to set popover content, i'm using a function
$('.blob a').webuiPopover({
template: template,
trigger: 'hover',
type: 'async',
url: '/ajax/getprofileinfo.php?user=433',
content: function(requestData) {
//executed after successful ajax request.
//How I can make another ajax call and then return everything to content?
}
});
Now... I can do any kind of things inside this callback. But what if I want to make another AJAX request inside this function (in this case i want to download Mustache template so i can render it with requestData and THEN return its output from the function
I tried something like this
content: function(requestData) {
var template = '';
$.get('/tpl/usertemplate.mustache').done(function(templateData) {
template = Mustache.render(templateData, requestData);
});
return template;
}
Without any luck. How to do it correctly? I know i could just set async to false, but it isn't "the right way".