简体   繁体   English

Magnific Popup Jquery:Ajax Popup无法正常工作

[英]Magnific Popup Jquery: Ajax Popup is not working

I am trying to show a web page content in popup window using Magnific Popup jquery 我正在尝试使用Magnific Popup jquery在弹出窗口中显示网页内容

I am using ajax type to show content. 我正在使用ajax类型显示内容。

I tried the below code. 我尝试了以下代码。

HTML: HTML:

<a class="ajax" href="http://www.google.com">
        Text
</a>

JQuery: jQuery的:

<script type="text/javascript">
        $(document).ready(function() {
            $('.ajax').magnificPopup({
                delegate: 'a',
                type: 'ajax',
                alignTop: true,
                overflowY: 'scroll' // as we know that popup content is tall we set scroll overflow by default to avoid jump
            }
        }

    });
        });
</script>

Please check the JSFIDDLE 请检查JSFIDDLE

In terms of Jquery I am a novice. 在Jquery方面,我是新手。 What I did wrong here? 我在这里做错了什么?

The problem are your external links. 问题是您的外部链接。 they can't be load/interpreted correctly cause the wrong MIME type. 无法正确加载/解释它们会导致错误的MIME类型。

http://dimsemenov-static.s3.amazonaws.com/dist/magnific-popup.css
http://dimsemenov-static.s3.amazonaws.com/dist/jquery.magnific-popup.min.js

Here is the fiddle with working external resources. 是工作外部资源的摆弄。

The "real" problem is that it don't work with a link on an other origin. “真实”的问题是它不能与其他来源的链接一起使用。

ERROR: Refused to display ' https://www.google.de/?gws_rd=ssl ' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'. 错误:拒绝在框架中显示“ https://www.google.de/?gws_rd=ssl ”,因为它将“ X-Frame-Options”设置为“ SAMEORIGIN”。

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

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