/**
 * 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 <[email protected]> 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 Orkuteer
http://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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/opensocial-orkut?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to