Inconsistent cross-browser results from .text() method
|Reported by:||dmethvin||Owned by:||dmethvin|
The .text() method returns different whitespace on different browsers. In the case of IE6/7, it sometimes returns no whitespace at all between adjacent text nodes, even though the corresponding .innerText result has white space.
This behavior has been in the .text() method for quite a while, so I don't think a lot of people have found it a critical problem. I would say that IE's lack of whitespace between text nodes is a bug.
The other whitespace differences might deserve some thought as well; for example, should IE's CR-LF sequences be changed to LF for consistency with the other browsers? Regardless, there will still be whitespace differences across browsers that jQuery can't control. For example, IE sometimes removes the trailing newline from text.
Sorta-related: Bug #2425
Change History (13)
comment:6 Changed 6 years ago by
|Milestone:||1.4.3 → 1.4.5|
|Priority:||minor → low|
|Status:||new → pending|
comment:7 Changed 6 years ago by
|Status:||pending → open|
|Version:||1.2.6 → 1.4.4|
comment:11 Changed 6 years ago by
|Component:||core → selector|
|Milestone:||1.next → 1.7|