【问题标题】:jQuery Fancybox is not supporting links are in post methodjQuery Fancybox 不支持链接在 post 方法中
【发布时间】:2017-04-23 14:40:59
【问题描述】:

我想在同一页面中管理 sql db 表,而不是导航到其他页面。 我脑子里有这段代码

<head>
        <title>All Magazine Data</title>
        <link rel="stylesheet" type="text/css" href="css/style.css">        
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.0.47/jquery.fancybox.min.js"></script>
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.0.47/jquery.fancybox.min.css" />     
        <script type="text/javascript">
                $(document).ready(function() {
                    $(".various").fancybox({
                        maxWidth    : 800,
                        maxHeight   : 600,
                        fitToView   : false,
                        width       : '70%',
                        height      : '70%',
                        autoSize    : false,
                        closeClick  : false,
                        openEffect  : 'none',
                        closeEffect : 'none'

                    });
                });
        </script>
    </head>

这是不工作的代码。

<a class="various fancybox.iframe" href="viewthumb.php?url=http://localhost/rupok/img/cover.png">View Cover</a>

当图像无效时,页面在 iframe 中加载。但是当我在 get 参数中链接有效图像时,它会显示一条消息

The Requested Content Can not be loaded

【问题讨论】:

  • 当您导航到viewthumb.php?url=http://localhost/rupok/img/cover.png 时会发生什么?
  • 它只是根据URL写入嵌入图像的HTML内容
  • 这是代码,
    下载 "/>

标签: javascript jquery html css fancybox


【解决方案1】:

您使用的是 v3,但 v2 中的选项 - 这些版本不兼容。 v3 中不存在您使用的任何选项。使用“数据类型”属性设置内容类型。

如果“无法加载内容”,则会出现该消息。检查开发人员工具以查看您的页面请求的状态。

【讨论】:

    猜你喜欢
    • 2021-11-01
    • 1970-01-01
    • 2011-06-28
    • 1970-01-01
    • 1970-01-01
    • 2020-04-13
    • 2019-12-17
    • 1970-01-01
    • 2023-02-05
    相关资源
    最近更新 更多