开发者

FB.Data.query with better performance

开发者 https://www.devze.com 2022-12-29 07:10 出处:网络
I\'m using this code for take user\'s events from facebook: var query = FB.Data.query(\"select eid,name,start_time,location,venue,pic_s开发者_JS百科mall,pic_big,description from event WHERE eid IN (S

I'm using this code for take user's events from facebook:

var query = FB.Data.query("select eid,name,start_time,location,venue,pic_s开发者_JS百科mall,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) {
   ...
}

but it's very slow. is there any way for get better performance?

thanks


You could try passing it to FB.api() instead:

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) {
  ...
});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号