Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Twitter bootstrap 3 引导程序3:在模式已打开时替换模式_Twitter Bootstrap 3 - Fatal编程技术网

Twitter bootstrap 3 引导程序3:在模式已打开时替换模式

Twitter bootstrap 3 引导程序3:在模式已打开时替换模式,twitter-bootstrap-3,Twitter Bootstrap 3,我有一套按钮,每个按钮都可以打开模式。第一个打开良好,但如果不关闭模式,第二个将失败,并显示“UncaughtTypeError:undefined不是函数” 我有很多链接: <a data-toggle="modal" data-dismiss="modal" data-target="#modal-form" href="partial/forums-modal.html">Open Modal A</a> <a data-toggle="modal" data

我有一套按钮,每个按钮都可以打开模式。第一个打开良好,但如果不关闭模式,第二个将失败,并显示“UncaughtTypeError:undefined不是函数”

我有很多链接:

<a data-toggle="modal" data-dismiss="modal" data-target="#modal-form" href="partial/forums-modal.html">Open Modal A</a>
<a data-toggle="modal" data-dismiss="modal" data-target="#modal-form" href="partial/facebook-modal.html">Open Modal B</a>

我试过:

也帮不了什么忙


是的,我在引导之前加载了jquery。

第一个错误“UncaughtTypeError”的修复程序是从引导3.1.1升级到3.2.0。完成此操作后,单击第二个div,模式关闭,而不是打开新内容

为了更新内容,我选择了ajax路径。这些模态本身是由ajax加载的(首先是移动的,它们不是移动的)。因此,与我使用的代码类似,我使用了以下代码:

$('body').on('click', 'a[data-target=#modal-form]', function(ev) {
        console.log("clicked");
        ev.preventDefault();
        var target = $(this).attr('href');

        $('#modal-form').load(target, function() {
            $('#modal-form').modal("show");
        });
    });