[jQuery] Binding events to newly added DOM elements

[jQuery] Binding events to newly added DOM elements

That almost sounds a little too automagical, but I don't have any better
ideas off the top of my head.
I guess you're thinking something along these lines (using append() as an
example)?
append: function() {
var cloner = this.cloner();
var a = $.clean(arguments);
return this.each(function(){
for ( var i in a )
this.appendChild( cloner( a[i] ) );
});
},

cloner: function() {
return( this.cur.length ?
function( node ) {
return node.cloneNode ? node.cloneNode(true) : node;
} :
function( node ) {
return node;
}
);
},
-Mike






















    • Topic Participants

    • mike