Modify ↓
Ticket #8923 (closed bug: worksforme)
IE $.trim (non-breaking spaces)
| Reported by: | anonymous | Owned by: | anonymous |
|---|---|---|---|
| Priority: | low | Milestone: | 1.next |
| Component: | core | Version: | 1.5 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
$.trim in IE, do not remove "non-breaking spaces"
<span id="example"> Hello <b>World</b> </span>
<script type="text/javascript">
var text = $("#example").text();
text = $.trim(text);
document.write(text.length);
</script>
Output in IE: Hello World 12
Others browsers: Hello World 11
Change History
comment:1 Changed 2 years ago by rwaldron
- Priority changed from undecided to high
- Status changed from new to open
- Component changed from unfiled to core
comment:2 Changed 2 years ago by mikesherov
There exists a unit test for this, but it uses this:
var nbsp = String.fromCharCode(160);
needless to say, IE must represent differently.
comment:4 Changed 2 years ago by dmethvin
- Owner set to anonymous
- Status changed from open to pending
The assumption that leading/trailing spaces may be at fault may be incorrect. Can you create a test case that shows the actual text retrieved? This may be related to #3144 and not a problem with $.trim().
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Confirmed