I've added your "hadError" IF, but it goes to the ELSE. That is to
say, no errors apear.
Can someone confirm what -Robson Dantas- says?

On Sep 25, 7:28 pm, "Arne Roomann-Kurrik" <[EMAIL PROTECTED]>
wrote:
> The API still provides a method to read activities, but I don't know which
> containers currently support doing so.  Orkut appears not to, as the
> following code (which checks for an error on the response) returns
> "unauthorized":
>
> function loadActivities() {
>   var req = opensocial.newDataRequest();
>   req.add(req.newFetchActivitiesRequest("VIEWER"), "activities");
>   req.send(onLoadActivities);
>
> };
>
> function onLoadActivities(data) {
>   if (data.get("activities").hadError()) {
>     alert("There was a problem getting the activities: " +
>         data.get("activities").getErrorCode());
>   }
>   output(data);
>
> };
>
> loadActivities();
>
> Hope this helps,
> ~Arne
>
>
>
> On Thu, Sep 25, 2008 at 7:07 AM, Robson Dantas <[EMAIL PROTECTED]> wrote:
> > Hi,
>
> > I was looking the differences between opensocial 0.6 & 0.7 at google
> > website. They've changed the activity example, so I'm guessing that you
> > cannot read activities, just write.
>
> > Is anybody can confirm that ?
>
> > --Robson
>
> > 2008/9/25 [EMAIL PROTECTED] <[EMAIL PROTECTED]>
>
> >> why doesn't the following code work?
>
> >> function RefreshActs()
> >> {
> >>        var req = opensocial.newDataRequest();
> >>        req.add(req.newFetchActivitiesRequest("VIEWER"),
> >> "viewer_activities");
> >>        req.send(onLoadActivities);
> >> }
>
> >> function onLoadActivities(data)
> >> {
> >>        var activities = data.get('viewer_activities').getData()
> >> ['activities'];
> >>        html = "<ul>";
> >>        activities.each(ShowActs(activity));
> >>        html += "<ul>";
> >>        document.getElementById('Activities').innerHTML = "The activities:
> >> <br>";
> >>        document.getElementById('Activities').innerHTML += html;
> >> }
>
> >> function ShowActs(activity)
> >> {
> >>        html+="<li>"+
> >> activity.getField(opensocial.Activity.Field.TITLE)+"</li><br>"
> >> }
>
> >> The Firefox Firbug says that "activities" is null. why?
> >> By the way, I use Orkut Sandbox (open social 0.7).
>
> --
> OpenSocial IRC - irc://irc.freenode.net/opensocial
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OpenSocial Application Development" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to