.data() puts the namespace after the dot ( . ), not before. So it's

$(el).data('something.myns', value);

Event namespacing in jQuery is this way also

$(el).bind("click.foo", fn1)
$(el).bind("click.bar", fn2)
$(el).bind("click", fn3)
$(el).unbind(".foo")

- Richard

On Tue, Jan 6, 2009 at 11:58 AM, Balazs Endresz <balazs.endr...@gmail.com>wrote:

>
> You can, but it's undocumented and unnecessary :)
>
> But you can have your own namespace:
> $(el).data('myns.something', value);
> so
> $(el).data('myns'); will return all your properties.
>
>
> On Jan 6, 5:06 pm, Ricardo Tomasi <ricardob...@gmail.com> wrote:
> > You can't see all data saved either..
> >
> > On Jan 6, 12:01 pm, Balazs Endresz <balazs.endr...@gmail.com> wrote:
> >
> > > Why not use $(el).data() for that?
> >
> > > On Jan 6, 12:57 pm, "Alexandre Plennevaux" <aplennev...@gmail.com>
> > > wrote:
> >
> > > > I would like to suggest a feature to add to jquery attributes
> commands:
> >
> > > > I 'm using custom attributes to store UI states. At some point i
> would find
> > > > it handy to be able to just console.log($(this).attr() ) to see all
> the
> > > > attributes and their value.
> >
> > > > Not a groundbreaking change, but a nice -to-have...
> >
> > > > thanks
> >
> > > > Alexandre
>

Reply via email to