Может быть, я не привык использовать функции, но у меня возникают проблемы с получением загрузочных всплывающих окон для возврата строки, полученной из функции.Может кто-нибудь помочь, пожалуйста?
$(".person").popover({
title: 'Default title value',
trigger: 'hover',
html: true,
content: function(){
var thisID = $(this).attr('id');
$.ajax({
type: 'GET',
url: "people.xml",
dataType: "xml",
success: function(xml) {
var xmlID = $(xml).find("id");
$(xmlID).each(function(id, item) {
if ($(item).text() == thisID) {
console.log($(item).parent().find('name').text()); //this is the correct name
return $(item).parent().find('name').text(); //but nothing appears in the popover content
}
});
}
});
}
});