Skip to content
Permalink
Browse files

Use the getText utility function provided by Sizzle.

  • Loading branch information
jeresig committed Dec 7, 2009
1 parent 2092789 commit 3f7fc25494988ee5be66c0af0d552b24f0ca1b79
Showing with 2 additions and 14 deletions.
  1. +1 −14 src/manipulation.js
  2. +1 −0 src/sizzle-jquery.js
@@ -36,20 +36,7 @@ jQuery.fn.extend({
return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
}

var ret = "";

jQuery.each( this, function() {
// Get the text from text nodes and CDATA nodes
if ( this.nodeType === 3 || this.nodeType === 4 ) {
ret += this.nodeValue;

// Traverse everything else, except comment nodes
} else if ( this.nodeType !== 8 ) {
ret += jQuery.fn.text.call( this.childNodes );
}
});

return ret;
return jQuery.getText( this );
},

wrapAll: function( html ) {
@@ -2,5 +2,6 @@ jQuery.find = Sizzle;
jQuery.expr = Sizzle.selectors;
jQuery.expr[":"] = jQuery.expr.filters;
jQuery.unique = Sizzle.uniqueSort;
jQuery.getText = getText;

return;

0 comments on commit 3f7fc25

Please sign in to comment.
You can’t perform that action at this time.