Facebook'Like'按钮打破了https / SSL [英] Facebook 'Like' button breaks https/SSL

查看:134
本文介绍了Facebook'Like'按钮打破了https / SSL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在电子商务网站上,我保留,我按照这里的说明添加了Facebook的按钮:

On an e-commerce website I maintain, I added a Facebook 'Like' button per the instructions here:

http://developers.facebook.com/docs/reference/plugins/like

我正在使用iframe方法:

I am using the iframe method:

<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fexample.com%2Fpage%2Fto%2Flike&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" 
  scrolling="no" frameborder="0" style="border:none; overflow:hidden; 
   width:450px; height:80px;" allowTransparency="true">
</iframe>

它有效,但如果客户碰巧登录到她的帐户,她会获得臭名昭着的 a href =http://37signals.com/svn/posts/1431-mixed-content-warning-how-i-loathe-thee =nofollow noreferrer>混合内容警告

It works, but if a customer happens to be logged into her account, she gets the infamous "mixed content warning"

有没有办法使用相同的Facebook'Like'按钮代码,但是在SSL模式下不会插入非https内容?

Is there a way to use the same Facebook 'Like' button code but in a way that will not interject non-https content when in SSL mode?

推荐答案

您可以避免对于支持SSL的域的SSL警告,不针对传输协议。例如而不是包含 http:// https:// ,使用 //

You can avoid SSL warnings for domains that support SSL by not being specific about the transport protocol. e.g. instead of including http:// or https://, use //.

而不是

<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fexample.com%2Fpage%2Fto%2Flike&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>

使用

<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fexample.com%2Fpage%2Fto%2Flike&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>

这篇关于Facebook'Like'按钮打破了https / SSL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆