Hovering over a link will trigger a popover with a 1 second delay containing user profile information, loaded using AJAX.
$(function() {
var timer = null;
var xhr = null;
$('.user_popup').hover(
function(event) {
var elem = $(event.currentTarget);
timer = setTimeout(function() {
timer = null;
xhr = $.ajax(
'/user/' + elem.first().text().trim() + '/popup').done(
function(data) {
xhr = null;
elem.popover({
trigger: 'manual',
html: true,
animation: false,
container: elem,
content: data
}).popover('show');
flask_moment_render_all();
}
);
}, 1000);
},
The popover displays correctly but the data from the AJAX call, which is an HTML table, is not populating.
The debugger confirms that the AJAX call is successful and the 'data' variable contains the desired information from another route in the app.
Replacing the 'content' option with a hardcoded string makes the popover display correctly, indicating an issue with the AJAX call.