Twitter bootstrap 引导:未捕获类型错误:对象[Object Object]没有方法';爆米花';
这搞乱了我的脑袋,这是代码:Twitter bootstrap 引导:未捕获类型错误:对象[Object Object]没有方法';爆米花';,twitter-bootstrap,Twitter Bootstrap,这搞乱了我的脑袋,这是代码: $(document).ready(function(){ $(".tour-popover").popover({html: true }); $('#1-popover').popover('show'); $('.next-popover').click(function(){ cur_num = parseInt($(this).attr('id'), 10); $('#'cur_num+'-pop
$(document).ready(function(){
$(".tour-popover").popover({html: true });
$('#1-popover').popover('show');
$('.next-popover').click(function(){
cur_num = parseInt($(this).attr('id'), 10);
$('#'cur_num+'-popover').popover('destroy');
});
});
我第一次使用popover()
方法来显示它时,它工作正常,但是如果我想销毁或隐藏它,它就不工作了,并抛出以下错误:Uncaught TypeError:Object[Object Object]没有方法“popover”
以下是文件的调用方式:
<link rel="stylesheet" href="files/bootstrap/css/bootstrap.css"/>
<link rel="stylesheet" href="files/bootstrap/css/bootstrap-responsive.css"/>
<link rel="stylesheet" href="files/custom-colors.css"/>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>
<link rel="stylesheet" href="files/main.css"/>
<script type="text/javascript" src="files/main.js"></script>
<script type="text/javascript" src="files/bootstrap/js/bootstrap.js"></script>
<script type="text/javascript" src="files/bootstrap/file-upload/bootstrap-fileupload.min.js"></script>
在加载引导程序之前,您似乎正在加载文件(main.js
)。在使用引导之前,您必须先加载它。您看到的js不在main.js文件中,而是在加载引导后的脚本标记中。您能显示HTML吗,这样我们就可以看到jQuery选择器正在选择什么了?只能初始化$(“.tour popover”)
选择的元素。。。您使用的其他元素(如$(“#1-popover”)
是否已初始化?