Facebook“喜欢”按钮断开https/ssl
-
01-10-2019 - |
题
在我维护的电子商务网站上,根据说明我添加了一个Facebook“喜欢”按钮:
http://developers.facebook.com/docs/reference/plugins/like
我正在使用iframe方法:
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fexample.com%2Fpage%2Fto%2Flike&layout=standard&show_faces=true&width=450&action=like&colorscheme=light&height=80"
scrolling="no" frameborder="0" style="border:none; overflow:hidden;
width:450px; height:80px;" allowTransparency="true">
</iframe>
它有效,但是如果顾客碰巧登录她的帐户,她就会臭名昭著”混合内容警告"
有没有一种方法可以使用相同的Facebook“喜欢”按钮代码,但是在SSL模式下不会插入非HTTPS内容的方式?
解决方案
您可以避免通过不针对运输协议具体而支持SSL的域的SSL警告。例如,不包括 http://
或者 https://
, , 采用 //
.
代替
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fexample.com%2Fpage%2Fto%2Flike&layout=standard&show_faces=true&width=450&action=like&colorscheme=light&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&layout=standard&show_faces=true&width=450&action=like&colorscheme=light&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>
其他提示
这是一个提示,Facebook.com支持SSL;)
您可以避免通过不针对运输协议具体而支持SSL的域的SSL警告。例如,不包括 http://
或者 https://
, , 采用 //
.
代替
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fexample.com%2Fpage%2Fto%2Flike&layout=standard&show_faces=true&width=450&action=like&colorscheme=light&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%2Fl
<iframe src="//www.facebook.com/plugins/follow?href=https%3A%2F%2Fwww.facebook.com%2Fludwika.karuna&layout=standard&show_faces=true&colorscheme=light&width=450&height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>
不隶属于 StackOverflow