【问题标题】:HTML iframe not working when i write src= of facebook当我编写 Facebook 的 src= 时,HTML iframe 不起作用
【发布时间】:2019-02-21 12:05:40
【问题描述】:

我的代码可以正常工作:

<div class="facebook">
          <div id="likebox-frame">
          <iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fbigfishbudapest&amp;width=320&amp;colorscheme=light&amp;show_faces=false&amp;border_color=&amp;stream=true&amp;header=false&amp;height=395" 
          scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:320px; height:395px;" allowTransparency="true"></iframe>
         </div>
        </div>

我需要它而不是把我带到这个 facebook 粉丝页面: https://www.facebook.com/bigfishbudapest/

它需要带我到这个 facebook 粉丝页面: https://www.facebook.com/bigfishlaspalmas/

【问题讨论】:

  • 你到了你在插件中指定的页面,为什么会有人想要转到与你喜欢的页面不同的页面(d)?

标签: html facebook iframe


【解决方案1】:

Facebook 在 HTTP 响应标头中使用 X-Frame-Options,因此您无法在 iFrame 中加载。

you can go through this

【讨论】:

    【解决方案2】:

    更新源 (src) 属性中的页面引用将显示您指定的页面。

    <iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fbigfishlaspalmas&amp;width=320&amp;colorscheme=light&amp;show_faces=false&amp;border_color=&amp;stream=true&amp;header=false&amp;height=395" 
          scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:320px; height:395px;" allowTransparency="true"></iframe>
    

    src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fbigfishbudapest&width=320&colorscheme=light&show_faces=false&border_color=&stream=true&header=false&height=395"

    src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fbigfishlaspalmas&width=320&colorscheme=light&show_faces=false&border_color=&stream=true&header=false&height=395"

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-10-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-04
      • 1970-01-01
      相关资源
      最近更新 更多