【发布时间】:2016-07-15 06:30:20
【问题描述】:
我正在使用最新版本:
- jQuery 3.0.0.1
- 引导程序 3.3.6.1
- 引导箱 4.4.0
我的 HTML:
A+ Certification, Grad. 2011 Comptia
<a id="e1658b80-0c48-e611-8277-14feb5fbeae8" class="glyphicon glyphicon-remove" title="Delete this entry" href="/[controller]/[action]/e1658b80-0c48-e611-8277-14feb5fbeae8"> </a>
我的 JavaScript,嵌入在删除链接正下方的页面中:
<stript type="text/javascript">
$(function () {
$('#39b75c0a-0a48-e611-8277-14feb5fbeae8').on('click', function(e) {
e.preventDefault();
bootbox.confirm('Do you wish to delete this entry?', function(result) {
if (result) { window.location = $(this).attr('href'); }
});
});
});
</script>
我的标题:
<script src="/Scripts/modernizr-2.8.3.js">
<script src="/Scripts/jquery-3.0.0.js">
<script src="/Scripts/bootstrap.js">
<script src="/Scripts/bootstrap-datepicker.js">
<script src="/Scripts/bootstrap-switch.js">
<script src="/Scripts/bootbox.js">
<script src="/Scripts/respond.js">
<script src="/Scripts/jquery.validate.js">
<script src="/Scripts/jquery.validate.unobtrusive.js">
<script src="/Scripts/metisMenu.js">
<script src="/Scripts/jquery.slimscroll.js">
<script src="/Scripts/jquery.peity.js">
<script src="/Scripts/jquery.mask.js">
<script src="/Scripts/script.common.js">
<script src="/Scripts/script.internal.js">
<link rel="stylesheet" href="/Content/bootstrap.css">
<link rel="stylesheet" href="/Content/bootstrap-datepicker3.css">
<link rel="stylesheet" href="/Content/bootstrap-switch/bootstrap3/bootstrap-switch.css">
<link rel="stylesheet" href="/Content/font-awesome.css">
<link rel="stylesheet" href="/Content/inspinia.css">
<link rel="stylesheet" href="/Content/style.internal.css">
(这些还没有缩小;生产输出将是。)
现在我已经设置好,尝试点击删除锚点实际上不会导致浏览器跟随锚点href(这很好,我们想警告用户使用模式!),但由于某种原因,模态对话框拒绝显示。屏幕没有变灰,什么都没有。
建议?
【问题讨论】:
-
Bootstrap 3.3.6.1 是否与 jQuery 3.0.0.1 兼容?您是否尝试打开 boostrap(不是 bootbox)模式?有没有 js 错误?
-
3.3.6.1 没有将最大版本设置为依赖项:nuget.org/packages/Bootstrap 以前的版本 3.3.6.0 做了nuget.org/packages/bootstrap/3.3.6 编辑: 好吧,知道什么…… NuGet 包没有完全正确构建,因为它们没有反映 jQuery 的正确 maxversion 依赖:github.com/twbs/bootstrap/blob/v3.3.6/bower.json
标签: javascript twitter-bootstrap twitter-bootstrap-3 bootbox