[jQuery] Re: feature suggestion: .attr() without params returns the whole list of attributes

2009-01-07 Thread Joe
Oh nice! Yeah what I need to do is get the source from you and add the cookie settings to the plugin. It's been working like a charm! joe On Jan 6, 11:45 am, Balazs Endresz balazs.endr...@gmail.com wrote: Hi Joe! Sorry, I was wrong, as the namespace is reversed. But maybe using it this

[jQuery] Re: feature suggestion: .attr() without params returns the whole list of attributes

2009-01-06 Thread Balazs Endresz
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

[jQuery] Re: feature suggestion: .attr() without params returns the whole list of attributes

2009-01-06 Thread Ricardo Tomasi
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

[jQuery] Re: feature suggestion: .attr() without params returns the whole list of attributes

2009-01-06 Thread Balazs Endresz
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,

[jQuery] Re: feature suggestion: .attr() without params returns the whole list of attributes

2009-01-06 Thread Richard D. Worth
.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,

[jQuery] Re: feature suggestion: .attr() without params returns the whole list of attributes

2009-01-06 Thread Karl Swedberg
I just played around in Firebug and noticed that DOM elements have an attributes property (in Firefox, at least), so I tried this, using the first textarea in my document as an example: var a = $('textarea')[0].attributes, attrs = []; for (i=0; i a.length; i++) {

[jQuery] Re: feature suggestion: .attr() without params returns the whole list of attributes

2009-01-06 Thread Alexandre Plennevaux
quite nice karl, thanx ! On Tue, Jan 6, 2009 at 6:09 PM, Karl Swedberg k...@englishrules.com wrote: I just played around in Firebug and noticed that DOM elements have an attributes property (in Firefox, at least), so I tried this, using the first textarea in my document as an example:

[jQuery] Re: feature suggestion: .attr() without params returns the whole list of attributes

2009-01-06 Thread Joe
Balazs, That throws an error in the data method. Joe On Jan 6, 10:06 am, 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,

[jQuery] Re: feature suggestion: .attr() without params returns the whole list of attributes

2009-01-06 Thread Balazs Endresz
Hi Joe! Sorry, I was wrong, as the namespace is reversed. But maybe using it this way is easier and a bit faster: $(el).data('myns', {}); var mydata=$(el).data('myns'); //save a reference mydata.prop=0; //set mydata.prop; //get Btw. if you're still working on it the translation plugin has