[jQuery] Re: Namespace attributes bug in Tickets now.

2007-06-26 Thread John Farrar
Thanks Dan and Mike! Specifically I need to add "another" return. I knew there was a simpler way to do it. :) John Mike Alsup wrote: John, If you want it as a plugin you need to add a return: jQuery.fn.j = function() { return this.filter(function(){ return jQuery(this).attr("coop

[jQuery] Re: Namespace attributes bug in Tickets now.

2007-06-26 Thread Mike Alsup
John, If you want it as a plugin you need to add a return: jQuery.fn.j = function() { return this.filter(function(){ return jQuery(this).attr("coop:manage") == "true"; }); }; Mike On 6/26/07, Dan G. Switzer, II <[EMAIL PROTECTED]> wrote: John, >Tried it again with this code... >

[jQuery] Re: Namespace attributes bug in Tickets now.

2007-06-26 Thread Dan G. Switzer, II
John, >Tried it again with this code... > >jQuery.fn.j = function(){ >jQuery(this).filter(function(){ >return jQuery(this).attr("coop:manage") == "true"; >}); >}; > >jQuery('form').j().each(function(){alert(jQuery(this).attr('id'))}); > >This is what I modified in an attempt to ge

[jQuery] Re: Namespace attributes bug in Tickets now.

2007-06-26 Thread John Farrar
Tried it again with this code... jQuery.fn.j = function(){ jQuery(this).filter(function(){ return jQuery(this).attr("coop:manage") == "true"; }); }; jQuery('form').j().each(function(){alert(jQuery(this).attr('id'))}); This is what I modified in an attempt to get it to work... and

[jQuery] Re: Namespace attributes bug in Tickets now.

2007-06-26 Thread Mike Alsup
No... that fix didn't return a "collection" that is "chainable". It certainly should, and it does for me. With a test page that has two forms the following alerts 2: var j = $("form").filter(function(){ return $(this).attr("coop:manage") == "true"; }); alert(j.size()); Mike

[jQuery] Re: Namespace attributes bug in Tickets now.

2007-06-26 Thread Dan G. Switzer, II
>Didn't the solution from the other email thread work? > >jQuery("form").filter(function(){ > return jQuery(this).attr("coop:manage") == "true"; >}); > >But yes, this is a pretty easy fix - I'll try to get it in for 1.1.3, >so you'll be able to do: >jQuery("[EMAIL PROTECTED]:manage=true]") And j

[jQuery] Re: Namespace attributes bug in Tickets now.

2007-06-26 Thread John Farrar
No... that fix didn't return a "collection" that is "chainable". It returns one at a time and that is why I wrote the more pragmatic code shown below. :) BTW... the more I use jQuery the more it seems like the "model js library"! Great job guys! John Farrar John Resig wrote: Didn't the

[jQuery] Re: Namespace attributes bug in Tickets now.

2007-06-26 Thread John Resig
Didn't the solution from the other email thread work? jQuery("form").filter(function(){ return jQuery(this).attr("coop:manage") == "true"; }); But yes, this is a pretty easy fix - I'll try to get it in for 1.1.3, so you'll be able to do: jQuery("[EMAIL PROTECTED]:manage=true]") --John On 6/2

[jQuery] Re: Namespace attributes bug in Tickets now.

2007-06-26 Thread John Farrar
GOT IT! First the code that worked... jQuery.fn.coopforms = function(){ var myForms = new Array(); jQuery('form').each(function(){ if(jQuery(this).attr("coop:manage")=="true") { myForms[myForms.length] = this; coopformlist = jQuery.ListAppend(coopformlist,thi

[jQuery] Re: Namespace attributes bug in Tickets now.

2007-06-26 Thread John Farrar
OK... that may work. Can you tell me how to make it chainable? John Mike Alsup wrote: John, Regarding arrays, you can simply wrap an array of elements in a jQuery object: var arr = []; // some code that pushes elements into arr $(arr).each(function() Mike but that doesn't return

[jQuery] Re: Namespace attributes bug in Tickets now.

2007-06-26 Thread Mike Alsup
John, Regarding arrays, you can simply wrap an array of elements in a jQuery object: var arr = []; // some code that pushes elements into arr $(arr).each(function() Mike but that doesn't return a collection of forms where the condition is true... and if you manually create an array th