在互联网如此发达的今天,分享已经成为了众多网站的趋势,包括facebook分享,微信分享,新浪微博分享等等。想要将产品或网站做到国际化,facebook分享是必需的,现在我们就来说一下facebook分享。
1.在页面的
标签中加入如下meta:
2.当然,content的内容要根据自己的需求来自己定。一般分享的内容有title,description,image,url,有这几个参数就足够分享我们想要分享的内容了。
3.在页面的分享按钮上加入单击事件,调用shareFB().
4.需要在facebook上将要进行分享的url进行注册。
(1)访问https://developers.facebook.com/tools/debug/og/object/(需要翻墙或者VPN)
(2)在Input URL输入你要进行注册的URL
(3)点击Fetch new scrape information
(4)在When shared, this is what will be included中看到的图片和内容就是你要分享的内容。
(5)facebook分享就实现了。
注:
这是从facebook官网开发者中找到的,对image的要求是,1200 X 630是最佳显示,图片要求至少是600 X 315
Use imagesthat are at least 1200 x 630 pixels for the best display on high resolutiondevices. At the minimum, you should use images that are 600 x 315 pixels todisplay link page posts with larger images.