X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fmanipulation.js;h=baab8c6c0e5940e9fd645ffd19e35d2e5e242bd9;hb=da51cd0e43d6d61e0d3d6c197cef1e658bad29bc;hp=930b3d9b92c97703e1ede4e1234c8ed973dc94ad;hpb=4e9fed3b16ed9612ed373d14a89294e98054f4dd;p=jquery.git diff --git a/src/manipulation.js b/src/manipulation.js index 930b3d9..baab8c6 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -32,6 +32,12 @@ if ( !jQuery.support.htmlSerialize ) { 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 ) ); } @@ -87,7 +93,7 @@ jQuery.fn.extend({ } }).end(); }, - + append: function() { return this.domManip(arguments, true, function(elem){ if ( this.nodeType === 1 ) {