【发布时间】:2016-12-28 07:34:21
【问题描述】:
在一个 html 页面中,我将 bootstrap 模型和 bootstrap popover 用于不同的目的。我使用 BS 模型来播放视频,使用 Popover 来分享这些视频。但我正面临 Popover 的 问题,并且 Bootstrap 模型运行良好。 & 在关闭模型弹出窗口后,在 Bootstrap 模型调用之前,弹出窗口也可以正常工作,并且在浏览器控制台中显示错误...
Uncaught TypeError: $(...).popover is not a function(...) &
未捕获的类型错误:无法读取 undefined(...) 的属性“提示”
我没有得到相关的解决方案,我尝试使用 jQuery.noconflict(), var $ = jQuery.noconflict() 以及
var bootstrapButton = $.fn 来解决.button.noConflict() // 将 $.fn.button 返回到先前分配的值
$.fn.bootstrapBtn = bootstrapButton 但同样的问题来了
如果有人遇到同样的问题......并得到相同的解决方案......然后帮助我解决同样的问题......在此先感谢
错误:
Uncaught TypeError: Cannot read property 'tip' of undefined(…)
Uncaught TypeError: $(...).popover is not a function(…)
我的项目中的 jQuery 和引导文件。
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
/*!
* Bootstrap v3.3.5 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under the MIT license
*/
<script type="text/javascript" src="js/libs/bootstrap.js"></script>
HTML
<a href="#"><img src="images/new_icons/sharing(22x22).png" height="40" width="40" class="share text-center" title="Share"></a>
jquery 弹出框
$(".share").popover({
html: true,
title: 'Share this with... <img width="20" height="20" title="close" data-toggle="clickover" src="/static/img/new_icons/close(32x32).png" onclick="$("#share_popover").popover("hide");" id="close_skigit" class="close-skigit">',
placement: 'auto bottom',
trigger: 'manual',
cache:true,
content: $("#shareContent").html(),
}).click(function(e){
$(this).popover('toggle');
e.preventDefault()
});
【问题讨论】:
-
您可以为此代码创建 JS Fiddle 示例吗?为了检查到底发生了什么。
-
你能写下你的漏洞代码来实际展示你的问题吗?
标签: jquery html twitter-bootstrap bootstrap-modal