I succeeded to retrieve Activities, but when I read the 'title' field, I get: <a name="&lid=FriendUpdates_profileUpdateInterests_friend_text" href="/ friend/profile/displayProfile.do?userid=337875611">asaf chen</a> has updated his profile interests.
Why do I see this like code and not like link+text ? On Sep 29, 8:04 am, yoichiro <[EMAIL PROTECTED]> wrote: > Hi asafc64, > > I seem that there is the syntax error in your code. You should close > the brackets of the alert() function. > > Well, I confirmed what can retrieve my activities just now in Hi5 > Sandbox(betasandbox.hi5.com) with the following code: > > var p = {}; > p[opensocial.IdSpec.Field.USER_ID] = opensocial.IdSpec.PersonId.OWNER; > var idSpec = opensocial.newIdSpec(p); > var req = opensocial.newDataRequest(); > req.add(req.newFetchActivitiesRequest(idSpec), "activities"); > req.send(function(data) { > var activities = data.get("activities").getData(); > activities.each(function(activity) { > alert(activity.getId() + " : " + > activity.getField(opensocial.Activity.Field.TITLE)); > }); > > }); > > I hope that you will be able to retrieve the activity soon. :) > > Regards, > Yoichiro > > On Sep 29, 8:58 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > Yes, you're right. I fogrot to copy this line, but it doesn't matter. > > I have this part of code: > > 1. function onLoadActivities(data) > > 2. { > > 3. if (data.hadError()) { > > 4. alert("Error: " + > > data.get("viewer_activities").getErrorMessage()); > > 5. return; > > 6. } > > 7. var activities = data.get('viewer_activities').getData(); > > 8. activities.each(function() > > { alert(activity.getField['title']; }); > > 9.} > > > It says: "missing ) after argument list" in line 8. why? > > And to my previous question: Can I read Activities in "hi5" ? > > > On Sep 28, 11:56 pm, "Simon Forman" <[EMAIL PROTECTED]> wrote: > > > > On Sun, Sep 28, 2008 at 4:13 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> > > > wrote: > > > > > Can I read Activities in v0.8 (like in "hi5")? > > > > > I wrote this: > > > > > function RefreshActs() > > > > { > > > > var req = opensocial.newDataRequest(); > > > > var spec = new opensocial.IdSpec(); > > > > spec.setField(opensocial.IdSpec.Field.USER_ID, > > > > opensocial.IdSpec.PersonId.OWNER); > > > > req.add(req.newFetchActivitiesRequest(spec), > > > > 'viewer_activities'); > > > > req.send(onLoadActivities); > > > > } > > > > > function onLoadActivities(data) > > > > { > > > > alert(activities==null); // I get "false" > > > > alert(activities['activities']==null); // I get "true" > > > > } > > > > > What is going on? > > > > What does "activities" really contain? > > > > There's a problem in your onLoadActivities() function, you foget the > > > line to get the activities: > > > > var activities = data.get('viewer_activities').getData(); > > > > ~S --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "OpenSocial Application Development" group. To post to this group, send email to opensocial-api@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---