Javascript 在iframe中使用引导模式调用页面?
我使用Bootsrap模式插件并调用其中的一些页面。当页面需要回发或重定向时,它不会在模式中发生,而是会更改页面。所以我想让它在iframe中显示页面,这是boostrap模式 这是我的模态函数。密码我应该如何修改它以在iframe中显示内容Javascript 在iframe中使用引导模式调用页面?,javascript,jquery,twitter-bootstrap,iframe,bootstrap-modal,Javascript,Jquery,Twitter Bootstrap,Iframe,Bootstrap Modal,我使用Bootsrap模式插件并调用其中的一些页面。当页面需要回发或重定向时,它不会在模式中发生,而是会更改页面。所以我想让它在iframe中显示页面,这是boostrap模式 这是我的模态函数。密码我应该如何修改它以在iframe中显示内容 $.fn.modal.defaults.spinner = $.fn.modalmanager.defaults.spinner = '<div class="loading-spinner" style="width: 200px; m
$.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>