mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Fixed the issue with .text() returning incorrect results.
This commit is contained in:
parent
a208222f37
commit
f96c860bbd
11
jquery/jquery.js
vendored
11
jquery/jquery.js
vendored
@ -110,11 +110,12 @@ jQuery.fn = jQuery.prototype = {
|
|||||||
text: function(e) {
|
text: function(e) {
|
||||||
e = e || this.get();
|
e = e || this.get();
|
||||||
var t = "";
|
var t = "";
|
||||||
for ( var j = 0; j < e.length; j++ )
|
for ( var j = 0; j < e.length; j++ ) {
|
||||||
for ( var i = 0; i < e[j].childNodes.length; i++ )
|
var r = e[j].childNodes;
|
||||||
t += e[j].childNodes[i].nodeType != 1 ?
|
for ( var i = 0; i < r.length; i++ )
|
||||||
e[j].childNodes[i].nodeValue :
|
t += r[i].nodeType != 1 ?
|
||||||
jQuery.fn.text(e[j].childNodes[i].childNodes);
|
r[i].nodeValue : jQuery.fn.text([ r[i] ]);
|
||||||
|
}
|
||||||
return t;
|
return t;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user