I knew that way, but thought that there was a "nicer" or "cleaner"
way.

Tks

On Feb 27, 2:26 pm, Robson Dantas <biu.dan...@gmail.com> wrote:
> Hi Pedro.
>
> The simplest way is to use a variable to count first five and then exit.
>
> var i=1;
> xpto.each(function(person){
>
>    if (i==5) return;
>
>    do stuff..
>
>    i++;
>
> });
>
> Let me know if it is what you want.
>
> Cheers,
>
> --Robson Dantashttp://blogdodantas.dxs.com.br
>
> 2009/2/27 Pedro Vicente <neteinst...@gmail.com>
>
>
>
> > Hello,
>
> > I've been looking at some examples of apps in hi5 and OpenSocial page.
>
> > All of them make a request of 10 friends for example, and then with
> > the xpto.each(function(person) { .... use them all.
>
> > My question is, how do i get only the 5 first friends of the 10 (so
> > that i can request a X ammount of friends and do some pages with them
> > without having to do a cycle with all of them...
>
> > Thanks in advanced and sorry if the is a more javascript question.
--~--~---------~--~----~------------~-------~--~----~
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 
opensocial-api+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/opensocial-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to