加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

twitter-bootstrap – Twitter Bootstrap模式 – 加载“远程”内

发布时间:2020-12-18 00:05:14 所属栏目:安全 来源:网络整理
导读:我正在尝试加载“远程”内容,基本上是通过HTTP请求(在同一站点上)发送的信息.返回的内容本身会抛出以下信息: div class="modal-header"button type="button" class="close" data-dismiss="modal" aria-hidden="true"times; /buttonh3Change Your Password/h
我正在尝试加载“远程”内容,基本上是通过HTTP请求(在同一站点上)发送的信息.返回的内容本身会抛出以下信息:
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;    </button>
<h3>Change Your Password</h3>
</div>
<div class="modal-body">
<form>
    <fieldset>
        <label>Your current password</label>
        <input type="password" placeholder="password">
        <label>Confirm current password</label>
        <input type="text" placeholder="password">

        <button type="submit" class="btn">Submit</button>
    </fieldset>
</form>
</div>
<div class="modal-footer">
    <a href="#" class="btn btn-primary" data-dismiss="modal">Close</a>
</div>

但是,对于显示远程内容的模式框,我相信我应该已经显示了模态体类:

<div class="modal fade hide" id="ajax">
    <div class="modal-body">
        <p>body content to be replaced</p>
    </div>
</div>

如何绕过这个,并提供完整的模态div内容并使其正确显示?

解决方法

看起来你想用网页填充模态体.您可以使用a标记并使用data-target属性来调用模态:

< a id =“file_attach”data-toggle =“modal”href =“http://fiddle.jshell.net/jhfrench/6K8rD/show/”data-target =“#utility”class =“btn”>模态1< / a>

Twitter documentation笔记

If a remote url is provided,content will be loaded via jQuery’s load
method and injected into the .modal-body. If you’re using the data
api,you may alternatively use the href tag to specify the remote
source.

有关示例,请参阅http://jsfiddle.net/jhfrench/qv5u5/(有关如何在多个调用链接之间重新使用一个模态的详细信息,请参阅How can I reuse one Bootstrap modal div?).

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读