The following code works fine on FF but on IE has a problem ... data.hadError() is always true... why? And how can I solve that. Thanks !
function init() {
//1: Create the DataRequest.
var request = opensocial.newDataRequest();
var fields = [
opensocial.Person.Field.HAS_APP,
opensocial.Person.Field.NAME,
opensocial.Person.Field.NICKNAME,
opensocial.Person.Field.PROFILE_URL];
// add the supported fields to the parameter list.
var params = {};
params[opensocial.DataRequest.PeopleRequestFields.PROFILE_DETAILS] = fields;
//2: Prepare RequestItems to be added to the DataRequest
// add the fetch person request to the queue.
request.add(request.newFetchPersonRequest(opensocial.IdSpec.PersonId.VIEWER, params), "viewer");
request.send(startResponse);
}
function startResponse(data) {
if (data.hadError()) {
//document.getElementById('add').style.display = "block";
var msg = "Error Occurred<br/>You MUST refresh whole window in order to load the game, would like to do it now?";
errorPageInit(msg);
} else {
var viewer = data.get("viewer");
if (viewer.hadError()) {
errorCode = viewer.getErrorCode();
//errorPage(errorCode);
if(errorCode == opensocial.ResponseItem.Error.FORBIDDEN || errorCode == opensocial.ResponseItem.Error.UNAUTHORIZED){
document.getElementById('add').style.display = "block";
}
}
else {
// START APP
}
}
}