facebook分享(含圖片),

來源:互聯網
上載者:User

facebook分享(含圖片),
一、查看當前URL下facebook資訊情況Open Graph Object Debugger<輸入URL,查看當前URL是否具有facebook資訊>:
https://developers.facebook.com/tools/debug/og/object/
Show existing scrape information:查看已配置的facebook資訊
Fetch new scrape information:設定新的facebook資訊
二、設定對應facebook資訊1. 所有資訊必須在對應URL下的頁面進行添加,如www.baidu.com,必須在baidu的首頁下進行添加
2. Facebook共用清單,參照下述URL
https://developers.facebook.com/docs/plugins/checklist
三、執行個體如:在http://tztest4.ptmind.cn/test.htm下,添加facebook分享代碼。

<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>facebook share test</title><meta property="og:site_name" content="site name"/><meta property="og:title" content="title"/><meta property="og:type" content="website"/><meta property="og:description" content="description"/><meta property="og:image" content="http://www.ptengine.jp/images/hatenablog.png"/><meta property="og:url" content="http://tztest4.ptmind.cn/test.htm"></head><body><script>function fbs_click(){window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent('http://tztest4.ptmind.cn/test.htm'),'sharer','toolbar=0,status=0,width=626,height=436');return false;}</script><a onclick="return fbs_click()" target="_blank"><img src="ADD_IMAGE_URL_HERE" alt="Share on Facebook" /></a></body></html>

Window.open()請參考:http://www.w3cschool.cc/jsref/met-win-open.html
facebook開發API:https://developers.facebook.com/docs/plugins/embedded-posts
分享按鈕:https://developers.facebook.com/docs/plugins/share-button/
參考文獻:http://blog.sina.com.cn/s/blog_6cd33db60100sd9j.html


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.