So the code errors out if you are a viewer of the application. What am
I doing wrong?
I am just trying to figure out if the user is a viewer or an owner of
the application. It errors out in IE.
<pre>
/**
* Request for friend information when the page loads.
*/
function getData() {
document.getElementById('message').innerHTML = 'Requesting
friends...';
var req = opensocial.newDataRequest();
req.add(req.newFetchPersonRequest('VIEWER'), 'viewer');
req.send(onLoadFriends);
};
/**
* Parses the response to the friend information request and generates
* html to list the friends along with their display name and picture.
*
* @param {Object} dataResponse Friend information that was requested.
*/
function onLoadFriends(dataResponse) {
var viewer = dataResponse.get('viewer').getData();
if(!viewer.isOwner()){
document.getElementById('message').innerHTML = "You are a Viewer.";
}else{
document.getElementById('message').innerHTML = "You are an Owner.";
}
};
_IG_RegisterOnloadHandler(getData);
</pre>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"OpenSocial API Definition" 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-api?hl=en
-~----------~----~----~----~------~----~------~--~---