Opened 15 years ago
Closed 15 years ago
#4125 closed bug (wontfix)
href changing in IE
Reported by: | john | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.3.2 |
Component: | core | Version: | 1.3.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
When you attempt to change the href of an anchor in IE (of which the text value is identical to the href) the text value will be changed, as well. Some workaround should be provided for this.
Change History (4)
comment:1 Changed 15 years ago by
comment:2 Changed 15 years ago by
Follow up: I tried method #1 on my site and it works just great. Here's the code I used:
$(alink).html($(alink).html()+"<wbr>"); $(alink).attr({href:val}); $(alink).html($(alink).html().replace(/<wbr>$/i,""));
comment:3 Changed 15 years ago by
need: | Review → Test Case |
---|
comment:4 Changed 15 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Should the core really try to fix this? Seems like such an edge case with a very simple workaround. Not even sure how this would fit into $.support.
I think this is better just documented.
Note: See
TracTickets for help on using
tickets.
Just as an fyi, it seems it's IE actually comparing the underlying html inside the <a> tag to see if that identically matches the href url. Even if the rendered text is the same, but the html is different (for instance the / character replaced with an html entity, or some part of the link text is wrapped in a <span> or <b>, etc), IE will not mess with things. So the proper check to see if IE needs to be quirk-fixed is something like: $(this).html()===$(this).attr("href")
Two thoughts on a workaround: