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
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...
>
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
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
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
>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
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
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
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
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
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
11 matches
Mail list logo