Commit f96c860b authored by John Resig's avatar John Resig

Fixed the issue with .text() returning incorrect results.

parent a208222f
......@@ -110,11 +110,12 @@ jQuery.fn = jQuery.prototype = {
text: function(e) {
e = e || this.get();
var t = "";
for ( var j = 0; j < e.length; j++ )
for ( var i = 0; i < e[j].childNodes.length; i++ )
t += e[j].childNodes[i].nodeType != 1 ?
e[j].childNodes[i].nodeValue :
jQuery.fn.text(e[j].childNodes[i].childNodes);
for ( var j = 0; j < e.length; j++ ) {
var r = e[j].childNodes;
for ( var i = 0; i < r.length; i++ )
t += r[i].nodeType != 1 ?
r[i].nodeValue : jQuery.fn.text([ r[i] ]);
}
return t;
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment