简体   繁体   English

如何在引导模式弹出窗口中加载整个视图(带有样式和脚本)

[英]how to load whole view(with styles and scripts) in bootstrap modal popup

I want to load one page into another(I'm working in laravel ). 我想将一页加载到另一页中(我在laravel中工作)。 I have form on page, when user clicks on button bootstrap popup modal is shown. 我在页面上有表单,当用户单击按钮引导程序弹出模态时。 so i need to load whole page (include scripts and styles) in this bootstrap popup modal. 因此,我需要在此引导弹出窗口模式中加载整个页面(包括脚本和样式)。 the problem is my loaded page in popup, doesn't work correctly(i guess because of scripts. main page has bootstrap, jQuery and so on, and my popup view also has jQuery and bootstrap, and some other scripts, so as I see it loads these scripts two times). 问题是我在弹出窗口中加载的页面无法正常工作(我想是因为脚本所致。主页具有bootstrap,jQuery等,并且我的弹出视图也包含jQuery,bootstrap和其他一些脚本,因此我看到了它会两次加载这些脚本)。 This is how console looks after my loaded page is poped out 这是弹出加载页面后控制台的外观 在此处输入图片说明

I use laravel unisharp file manager github 我使用laravel unisharp文件管理器github

here's my edit button 这是我的编辑按钮

<a class="few_edits btn green default edit-vid-btn" href="#" data-toggle="modal" data-target="#edit-vid">Edit video</a>

my js 我的js

$(function(){
        $(".edit-vid-btn").on('click', function(){

            //window.open('/laravel-filemanager/?type=Files', 'File Manager',"width=700,height=500");

            /*$.ajax({
                url: "/laravel-filemanager/?type=Files",
                type: 'get',
                success: function(data) {
                    $('.modal-video-cont').append(data);
                }
            })*/

            $('.modal-video-cont').load('/laravel-filemanager/?type=Files');

        });
    });

is there way to fix it? 有办法解决吗?

If you have the same problem, just append your loaded data in iframe. 如果您有同样的问题,只需将已加载的数据附加到iframe中即可。 that's it) 而已)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM