git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a208222
)
Fixed the issue with .text() returning incorrect results.
author
John Resig
<jeresig@gmail.com>
Wed, 5 Jul 2006 02:01:24 +0000
(
02:01
+0000)
committer
John Resig
<jeresig@gmail.com>
Wed, 5 Jul 2006 02:01:24 +0000
(
02:01
+0000)
jquery/jquery.js
patch
|
blob
|
history
diff --git
a/jquery/jquery.js
b/jquery/jquery.js
index
2874e52
..
06d7504
100644
(file)
--- a/
jquery/jquery.js
+++ b/
jquery/jquery.js
@@
-110,11
+110,12
@@
jQuery.fn = jQuery.prototype = {
text: function(e) {
e = e || this.get();
var t = "";
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;
},
return t;
},