FB.Data.query具有更好的性能

时间:2010-05-07 17:39:40

标签: javascript events facebook facebook-fql

我正在使用此代码从facebook获取用户的活动:

var query = FB.Data.query("select eid,name,start_time,location,venue,pic_small,pic_big,description from event WHERE eid IN (SELECT eid FROM event_member WHERE uid={0}) AND start_time >= now() ORDER BY start_time LIMIT 10", 
            uid);                       
query.wait(function(rows) {
   ...
}

但它很慢。有什么方法可以获得更好的表现吗?

感谢

1 个答案:

答案 0 :(得分:0)

您可以尝试将其传递给FB.api()

var fql = "select eid, name, start_time FROM event WHERE eid IN (SELECT eid FROM event_member WHERE uid=0) AND start_time >= now() ORDER BY start_time LIMIT 10";
FB.api("/fql?=" + fql, function(response) {
  ...
});