Twitter bootstrap 引导弹出框必须刷新

Twitter bootstrap 引导弹出框必须刷新,twitter-bootstrap,popover,document-ready,Twitter Bootstrap,Popover,Document Ready,我在我的项目中使用Bootstrap中的popover。由于某些原因,我无法在$document.ready函数中初始化它。我必须使用$window.loadlike $(window).load(function() { $('.popoverMessage').popover({ placement: 'right', trigger: 'hover focus' }); }); 但是如果我像这样初始化popover,我必须刷新页面才能让po

我在我的项目中使用Bootstrap中的popover。由于某些原因,我无法在$document.ready函数中初始化它。我必须使用$window.loadlike

$(window).load(function() {
    $('.popoverMessage').popover({
        placement: 'right',
        trigger: 'hover focus'
    });
});
但是如果我像这样初始化popover,我必须刷新页面才能让popover工作。 你知道这个问题吗?为什么我必须重新加载页面

在$document.ready函数中,我返回popover超链接:

'<a href="#" class="popoverMessage" title="" data-content="'+users+'">'+data.length+' users</a>'

用户和数据都来自数据库。

你也可以发布HTML吗?@RayHenry我在文档中返回HTML。准备好了你返回popover超链接是什么意思?你是说你在用javaScript将锚定标记注入HTML吗?@RayHenry这意味着我只是将popover作为超链接标记返回,如果不看到你的HTML文件,这太难诊断了。