Facebook 'como' rompe botón HTTPS / SSL
-
01-10-2019 - |
Pregunta
En un sitio de comercio electrónico mantengo, he añadido un botón de Facebook 'Me gusta' según las instrucciones aquí:
http://developers.facebook.com/docs/reference/plugins/like
Estoy utilizando el método de marco flotante:
<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>
Funciona, pero si un cliente pasa a estar conectado en su cuenta, se pone el famoso " contenido mixto advertencia"
¿Hay una manera de utilizar código del botón de la misma Facebook 'Me gusta', pero de una manera que no se interject no https contenido cuando está en modo SSL?
Solución
Se puede evitar advertencias SSL para los dominios que soportan SSL por no ser específico sobre el protocolo de transporte. p.ej. en lugar de incluir http://
o https://
, el uso //
.
en lugar de
<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>
uso
<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>
Otros consejos
Aquí tiene una pista, facebook.com soporta SSL;)
Se puede evitar advertencias SSL para los dominios que soportan SSL por no ser específico sobre el protocolo de transporte. p.ej. en lugar de incluir http://
o https://
, el uso //
.
En lugar de
<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>
uso
<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>