jQuery.fn.extend({
text: function( text ) {
+ if(jQuery.isFunction(text)) {
+ return this.each(function() {
+ return jQuery(this).text( text.call(this) );
+ });
+ }
+
if ( typeof text !== "object" && text !== undefined ) {
return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
}
}
}).end();
},
-
+
append: function() {
return this.domManip(arguments, true, function(elem){
if ( this.nodeType === 1 ) {
return;
}
- var events = jQuery.data( orig[i], "events" );
-
- for ( var type in events ) {
- for ( var handler in events[ type ] ) {
- jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
- }
- }
+ jQuery.data( this, jQuery.data( orig[i++] ) );
});
}