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 SlexAxton
- Milestone changed from 1.4.3 to 1.4.5
- Priority changed from minor to low
- Status changed from new to pending
comment:7 Changed 6 years ago by jitter
- Keywords needsreview added
- Status changed from pending to open
- Version changed from 1.2.6 to 1.4.4
comment:10 Changed 5 years ago by timmywil
- Resolution set to fixed
- Status changed from open to closed
comment:11 Changed 5 years ago by timmywil
- Component changed from core to selector
- Keywords needsreview removed
- Milestone changed from 1.next to 1.7