gpt4 book ai didi

javascript - 使用 bootstrap 模式调用 iframe 中的页面?

转载 作者:行者123 更新时间:2023-11-28 08:26:51 27 4
gpt4 key购买 nike

我使用this Bootsrap 模态插件并调用其中的某些页面。当页面需要回发或重定向时,它不会在模式中发生,而是会更改页面。所以我希望它在 iframe 中显示处于 boostrap 模式的页面。

这是我的模态函数。代码;我应该如何修改它以在 iframe 中显示内容?

$.fn.modal.defaults.spinner = $.fn.modalmanager.defaults.spinner =
'<div class="loading-spinner" style="width: 200px; margin-left: -100px;">' +
'<div class="progress progress-striped active">' +
'<div class="progress-bar" style="width: 100%;"></div>' +
'</div>' +
'</div>';

$.fn.modalmanager.defaults.resize = true;

var $modal = $('#ajax-modal');

$('.modal-edit').on('click', function () {
// create the backdrop and wait for next modal to be triggered
$('body').modalmanager('loading');

var edit = $(this).attr("data-id");
setTimeout(function () {
$modal.load('User.aspx?edit=' + edit + '', '', function () {
$modal.modal();
});
}, 100);
});

这是我的模态模态 div:

  <div id="ajax-modal" class="modal fade" tabindex="-1" data-width="760" data-replace="true">
</div>

最佳答案

试试这个;

    $('.modal-edit').on('click', function () {
// create the backdrop and wait for next modal to be triggered
$('body').modalmanager('loading');
var edit = $(this).attr("data-id");
setTimeout(function () {
$modal.on('show', function () {
$('iframe').attr("src", 'Customer_User.aspx?edit=' + edit + '');
});
$modal.modal()
//$modal.load('Customer_User.aspx?edit=' + edit + '', '', function () {
// $modal.modal();
//});
}, 100);
});


<div id="ajax-modal" class="modal fade" tabindex="-1" data-width="760" >
<iframe ></iframe>
</div>

关于javascript - 使用 bootstrap 模式调用 iframe 中的页面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22296167/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com