It works in Orkut Sandbox when VIEWER = OWNER. If its not, I cant get any data. When I try to login as someone else (not the OWNER), I get no return.
On 30 mar, 10:40, Prashant Patil <prashantpandurangpa...@gmail.com> wrote: > /** > * Request VIEWER name. > */ > function getData() { > var req = opensocial.newDataRequest(); > req.add(req.newFetchPersonRequest > (opensocial.DataRequest.PersonId.VIEWER, 'viewer'); > req.send(onLoad); > }; > > function onLoad(dataResponse) { > var viewer = dataResponse.get('viewer').getData(); > var html = 'Viewer name: ' + viewer.getDisplayName(); > document.getElementById('dom_handle').innerHTML = html; > }; > > getData(); > > working fine just call the getData Function after loading or onload gadget! > > > > On Mon, Mar 30, 2009 at 1:55 AM, Samir Kerbage <samir...@gmail.com> wrote: > > > Hi, > > > Im having problems with this sample code. > > Im only trying to get the Viewer's name. > > I tested it on the sandbox logged as the OWNER of the app and it was > > OK. > > But when Im not the OWNER (trying to run the app as a OWNER friend) I > > get no return. > > If I change the the "opensocial.DataRequest.PersonId.VIEWER" to > > "opensocial.DataRequest.PersonId.OWNER", > > then i get the OWNER's name. But i WANT the viewer's name. > > > Can someone help me? > > thanks > > > /** > > * Request VIEWER name. > > */ > > function getData() { > > var req = opensocial.newDataRequest(); > > req.add(req.newFetchPersonRequest > > (opensocial.DataRequest.PersonId.VIEWER, 'viewer'); > > req.send(onLoad); > > }; > > > function onLoad(dataResponse) { > > var viewer = dataResponse.get('viewer').getData(); > > var html = 'Viewer name: ' + viewer.getDisplayName(); > > document.getElementById('dom_handle').innerHTML = html; > > }; > > -- > With best Regards. > Prashant aka > Orkuteerhttp://en.blog.orkut.com/2007/11/thanks-from-orkuteer.html --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---