我正在使用这段代码:
function newInvite(){
var user_ids = document.getElementsByName("user_ids")[0].value;
FB.ui({method: 'apprequests',
message: 'My Great Request',
to: user_ids,
});
}
我需要存储从这个函数获得的请求 ID
function loadFriends()
{
//get array of friends
FB.api('/me/friends?fields=name,first_name,gender', function(response) {
console.log(response);
var divContainer=$('.facebook-friends');
var testdiv = document.getElementById("test");
for(var i=0; i<response.data.length; i++){
if(response.data[i].gender == 'male'){
testdiv.innerHTML += response.data[i].id + '<br />';
}
}
});
}
我该怎么做?