Hello Developers,

The following code is working and giving me my friend list on Open
Social Dev App(orkut) [the platform to test codes]. However when
trying on Sandbox the alert("here2") doesn't work. i.e. the code
doesn't enter the loop in function onLoadFriends()
Any clues. Would highly appreciate.

thanks a tonn
Shikhar Sachan


 function loadFriends() {
var params = {};
var fieldz = [opensocial.Person.Field.ID,opensocial.Person.Field.THUMBNAIL_URL];
params[opensocial.DataRequest.PeopleRequestFields.MAX] = 10000;
params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] = fieldz;
var req = opensocial.newDataRequest();
req.add(req.newFetchPersonRequest('VIEWER'), 'viewer');
req.add(req.newFetchPeopleRequest('VIEWER_FRIENDS',params), 'viewerFriends');
req.add(req.newFetchPersonAppDataRequest('VIEWER', 'gifts'), 'data');
req.add(req.newFetchPersonAppDataRequest('VIEWER_FRIENDS', 'gifts'),
'viewerFriendData');
req.send(onLoadFriends);
}

function onLoadFriends(data) {
var viewer = globalViewer = data.get('viewer').getData();
var viewerFriends = data.get('viewerFriends').getData();
var giftData = data.get('data').getData();
var viewerFriendData = data.get('viewerFriendData').getData();
var friends = new Array();

html2=new Array();
html2.push('<select id="person">');
var i = 0;
alert('here1');
viewerFriends.each(function(person) {
alert('here2');
html2.push('<option value="' + person.getId() + '">' +
person.getDisplayName() + "</option>");
i=i+1;
});

html2.push('</select>');
document.getElementById('dom_handle').innerHTML = html2.join('');
}

loadFriends();

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Orkut Developer Forum" group.
To post to this group, send email to opensocial-orkut@googlegroups.com
To unsubscribe from this group, send email to 
opensocial-orkut+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/opensocial-orkut?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to