2013-06-29 59 views
0

我需要排除在邀請對話框要求和功能looklike如何從Fb.api傳遞價值Fb.ui

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

回答

0

移動的朋友var responsive = '';從函數到全局範圍。然後您可以從其他所有功能訪問它。請記住,API調用是異步的,所以您需要等待請求的完成(jQuery Deferreds可能會幫助您)