#3904 closed bug (worksforme)
$('<span> </span>') ie bug - jQuery 1.2.6 & 1.3 both
Reported by: | MarionNewlevant | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.3.1 |
Component: | core | Version: | 1.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
$('<span> </span>').contents().length is 1 in firefox and safari, 0 in ie (6 & 7). (maybe hard to read: this is a span containing a single space) I have a work-around: $('<span/>').text(' ').contents().length is 1 everywhere.
jQuery 1.2.6 & 1.3 both.
Change History (2)
comment:1 Changed 13 years ago by
Component: | unfilled → core |
---|
comment:2 Changed 13 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
That's actually the way contents() works:
http://api.jquery.com/contents/
As .html() mentions, browsers don't always treat white space the exact same way. That's outside the control of jQuery though.