Feed on
Posts
Comments
Email訂閱
  1. 原本愛心推薦機制在3.14版
  2. 針對主題、日期等的遊記分別推薦機制取消,現在不管在什麼地區按讚都一起統計。
  3. 現在已無法判斷是誰按了讚,所以移除相關判斷是否是自己按讚的程式碼
  4. 採用XFBML,才能捉到event
  5. 非同步初始化FB物件
  6. 動態載入內容之後,必須再parse一次。
  7. 取消顯示作者最近發表文章數

非同步初始化FB物件以及註冊抓取「讚」按鈕的事件
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({appId: 'yourappid', status: true, cookie: true, xfbml: true});

FB.Event.subscribe('edge.create', function(href, widget) {
//do somethings about href
});

FB.Event.subscribe('edge.remove', function(href, widget) {
//do somethings about href
};
};

(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/zh_TW/all.js';
document.getElementById('fb-root').appendChild(e);
}());
</script>

重新pare 內含XFBML語法的資料
var e = document.createElement('div');
e.innerHTML = response; // response為Ajax回傳的動態內容
FB.XFBML.parse(e);

 

留言區