[annotator-dev] Data questions
ewk-ml at connettivo.net
ewk-ml at connettivo.net
Mon Jul 7 13:15:01 UTC 2014
Il 2014-07-03 17:08 Randall Leeds ha scritto:
> On Jul 3, 2014 4:20 AM, "Ernesto Torresin (ML)"
> <ewk-ml at connettivo.net> wrote:
> >
> > I'm taking note of this... but with annotator 1.2.9 I'm getting
> that if
> > in Firebug console I execute
> >
> > var hls = $('.annotator-hl');
> > var hlanns = hls.data('annotation');
> > console.log(hls);
> > console.log(hlanns);
> >
> > if I have MANY highlights, I only get ONE annotation.
> >
> > What is the correct way to get ALL the annotations?
> >
> > TIA
> >
> > E.T.
> > PS hope I'm not making a silly mistake...
> >
> >
>
> You are, but that's okay.
>
> .data only returns the data for the first in the collection.
>
> You'll need to use one of the methods available in jQuery (or plain
> JavaScript) to iterate over the collection and call .data on each one.
Thanks! I'll try this out in the next days.
E.T.
More information about the annotator-dev
mailing list