0

我需要在邀请对话请求和功能上排除朋友

duplicate:function(){
   var responsive = '';
    FB.api(
      {
            method: 'fql.query',
            query:'SELECT uid,name  FROM user WHERE uid IN \n\
         (SELECT uid2 FROM friend WHERE uid1 = me()) AND is_app_user = 1 '
      },
      function(response) { 
         responsive = response;} 
  );
      return responsive;
}, 

onInviteClick: function(responsive) {
            FB.ui(  {
                method: 'apprequests',
                title: 'Popsecret ป็อบคอร์นแสนอร่อย',
                exclude_ids: responsive
                message: 'ชวนคุณกดไลท์เพื่อลุ้นรับไอแพดเเละของรางวัลอีกมากมาย',
                max_recipients: 15
            } , function(response) {
        if (response !== null) {

            $.post(Site.inviteCallbackURL, response, function(res) {

            });
        }
    });

而且我无法将数据从重复项传递到 onInviteClick

4

1 回答 1

0

将 varresponsive = '';从函数移动到全局范围。然后您可以从所有其他功能访问它。请记住,API 调用是异步的,因此您需要等待请求完成(jQuery Deferreds可能会帮助您)

于 2013-07-01T08:00:32.200 回答