小编Ves*_*led的帖子

Ajax Bootstrap Popover:对象#<Object>没有方法'popover'

我正在尝试构建一个Ajax Bootstrap Popover来显示包含评级星系统的页面.

这里的javascript第一次运行得很好.然后我有这个错误:

未捕获的TypeError:对象#没有方法'popover'

我不是很擅长jQuery,但我想这似乎是由于ajax调用,但我无法找到问题所在.

$(".myRate")
        .popover({
            offset: 10,
            trigger: 'manual',
            animate: false,
            html: true,
            placement: 'top',
            template: '<div class="popover" onmouseover="$(this).mouseleave(function()  {$(this).hide(); });"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'

        });
$('.myRate').mouseenter(popoverDisplay);

popoverDisplay = function() {
var el = $(this);
var _data = el.attr('alt');
$.ajax({
     type: 'GET',
     url: 'notes.php',
     data: _data,
     cache: false,
     dataType: 'html',
     success: function(data) {
        el.attr('data-content', data);
        el.popover('show');
     }
  });
}
Run Code Online (Sandbox Code Playgroud)

我不知道我做错了什么......有什么想法吗?

编辑:

搜索后,似乎是加载的页面导致此错误.

正是这部分:

似乎加载jquery-1.7.2.js会产生错误,因为如果我删除它,错误就会消失.问题:我无法删除它因为没有它jRating不再起作用:/

ajax popover twitter-bootstrap

10
推荐指数
2
解决办法
1万
查看次数

标签 统计

ajax ×1

popover ×1

twitter-bootstrap ×1