【问题标题】:fancybox open inline content but not iframe [duplicate]fancybox 打开内联内容但不是 iframe [重复]
【发布时间】:2013-06-26 13:54:54
【问题描述】:

一切正常

        function openContent (id) {
            $.fancybox('<h1>Lorem lipsum</h1>');
        }

但是当我尝试打开 iframe 时,什么也没有发生

        function openContent (id) {
            $.fancybox.open({href:'http://www.google.com'});
        }

firebug 或 chrome 控制台中没有错误消息。 我正在本地主机中尝试。

有什么想法吗?

【问题讨论】:

标签: javascript jquery fancybox


【解决方案1】:
 X-Frame-Options:SAMEORIGIN

header 在 www.google.com 中设置,如果您的网站不在 google.com 中,则无法在 iframe 中打开 www.google.com。

【讨论】:

  • 谢谢,google 只是一个建议。我正在尝试对同一文件夹“iframe.html”中的文件进行相同操作,但也不起作用
  • 按照这个链接fancybox.net/blog试试$.fancybox({href:'example.com'});
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-04-27
  • 1970-01-01
相关资源
最近更新 更多