Side navigation
#8923 closed bug (worksforme)
Opened April 20, 2011 07:03AM UTC
Closed June 11, 2011 08:00PM UTC
IE $.trim (non-breaking spaces)
| Reported by: | anonymous | Owned by: | anonymous |
|---|---|---|---|
| Priority: | low | Milestone: | 1.next |
| Component: | core | Version: | 1.5 |
| Keywords: | Cc: | ||
| Blocked by: | Blocking: |
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
Attachments (0)
Change History (6)
Changed April 27, 2011 02:28AM UTC by comment:1
| component: | unfiled → core |
|---|---|
| priority: | undecided → high |
| status: | new → open |
Changed June 09, 2011 11:22PM UTC by comment:2
There exists a unit test for this, but it uses this:
var nbsp = String.fromCharCode(160);
needless to say, IE must represent differently.
Changed June 09, 2011 11:35PM UTC by comment:3
I can't reproduce this in IE8. IE7?
Changed June 11, 2011 07:45PM UTC by comment:4
| owner: | → anonymous |
|---|---|
| status: | open → 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().
Changed June 11, 2011 07:45PM UTC by comment:5
| priority: | high → low |
|---|
Changed June 11, 2011 08:00PM UTC by comment:6
| resolution: | → worksforme |
|---|---|
| status: | pending → closed |
OK, this example is almost exactly what was reported, and it's working in IE6/7/8 for me:
Confirmed