Author Archives: ajpiano
Have you ever written a bit of jQuery code that looks like this? var pee = []; $(".poo").each(function() { pee.push(this.id); }); pee.join(); Or even worse, this? var pee = "", poo = $(".poo"); poo.each(function(i,elem) { pee += this.id; if (i < poo.length) { pee += ","; } }); If you are are doing Array.push or [...]
Posted in Uncategorized | Leave a comment
The opposite of jQuery’s .is() method is not .not(), it is !.is()
FAR too often I have seen people who are new to jQuery make the same irritating mistake, which I want to address once and for all. jQuery has an .is() method, which checks to see if at least one element in the current jQuery selection matches a selector, and returns a boolean reflecting this fact. [...]
Posted in Programming 3 Comments