X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fmanipulation.js;h=17cfa842dc6d9f48ac389cdd5701233e728aa214;hb=f078e930edb25190bb04c682ad067b72331b6e69;hp=930b3d9b92c97703e1ede4e1234c8ed973dc94ad;hpb=4b70f006f579fba24a882d80ca67f1971dbb4922;p=jquery.git diff --git a/src/manipulation.js b/src/manipulation.js index 930b3d9..17cfa84 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 ) {