javascript - 我想使用 intercooler.js 将内容加载到 bootstrap 4 模式中

标签 javascript ajax bootstrap-4

我正在尝试使用中间冷却器将内容加载到模态中,示例如下:

http://jsfiddle.net/qvpy3coL/3/

我很不高兴,想知道这是否可能,或者引导js是否会冲突?

HTML 是:

<div id="confirm-me" class="btn btn-primary" data-toggle="modal" 
    data-target="#msgmodal" ic-get-from="/click" ic-target="dynamiccontent"
    ic-trigger="click">
    Click Me to show dynamic modal</div>

<div class="modal fade" id="msgmodal">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                 <h4 class="modal-title">
                 Below will be dynamic content</h4>
            </div>

            <div id="dynamiccontent">
            </div>
        </div>
    </div>
</div>

js 是:

// mockjax stuff ...
$.mockjax({
    url: "/click",
    responseTime: 500,
    response: function (settings) {
        this.responseText = "Dynamic stuff here!";
    }
});

最佳答案

我从未使用过中冷器,但快速阅读后发现应该没有问题。

您想要在模式中使用动态内容的唯一要求是它应该是有效的 HTML 代码。

我使用了您放入一些内容的示例:

$('#dynamiccontent').html('No, it wont have any problems as long as your placing HTML')

https://jsfiddle.net/5pe6yz0w/3/

关于javascript - 我想使用 intercooler.js 将内容加载到 bootstrap 4 模式中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58349872/

相关文章:

twitter-bootstrap - 拉伸(stretch) CSS 背景(仅更改宽度)

html - Bootstrap 阴影未显示在 nav.shadow 上

php - 无需 PHP/JAVASCRIPT 对话的原始数据打印

javascript - 将元素从一个对象复制到另一个对象并将其显示为 json

javascript - 组合地理定位框架

php - Facebook Jquery ajax 权限请求?

javascript - 填充 AJAX javascript/jQuery 下拉列表(省、州、城市)有时会给出未定义的结果

php - 在 ajax 请求中处理 session_regenerate_id()

HTML、CSS、Bootstrap - 两列居中

javascript - 在 jquery 中循环一组 3 个函数 - 简单吗?