I'm getting the following error in my console:
Cannot read property 'achievement' of undefined
The code I'm using is directly from the online examples (script link and initialise are not included below but are ok).
//Show Achievements
function showAchList() {
var result;
var achievementService = new App42Achievement();
achievementService.getAllAchievements({
success: function(object)
{
var avatarObj = JSON.parse(object);
result = avatarObj.app42.response.avatars.achievement;
if(result.length == undefined)
{
console.log("Achievement Name is :" + result.name);
console.log("Description is :" + result.description);
}
else
for(var i = 0;i<result.length;i++){
console.log("Achievement Name is :" + result[i].name);
console.log("Description is :" + result[i].description);
}
},
error: function(error)
{
console.log("Exception is : " + error)
}
});
}