Closed yuchi closed 12 years ago
From the actual example:
// jQuery $('.foo').each( function() { this.some_method(); } ); // YUI Y.all('.foo').each( function() { this.some_method(); } );
Should be:
$('.foo').each( function() { $(this).some_method(); // notice the wrapped `this` } );
While this in the traverser in YUI is a Node object, in jQuery is the actual HTMLElement! Not only the example should be edited, but a little note IMO is required.
this
! Good catch.
From the actual example:
Should be:
While
this
in the traverser in YUI is a Node object, in jQuery is the actual HTMLElement! Not only the example should be edited, but a little note IMO is required.