Ticket #11129 (closed bug: cantfix)
.attr('href') returns full url in IE7
| Reported by: | timing | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | None |
| Component: | attributes | Version: | 1.7.1 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
This bug: http://bugs.jquery.com/ticket/2747 Is reintroduced in jQuery 1.7.1
Change History
comment:1 Changed 18 months ago by timmywil
- Priority changed from undecided to low
- Resolution set to worksforme
- Status changed from new to closed
- Component changed from unfiled to attributes
comment:2 Changed 15 months ago by marcn
Note that in the original ticket http://bugs.jquery.com/ticket/2747 there was a mention of it failing when the link was created using innerHTML. The jsfiddle posted on the closing of the bug didn't use a dynamically created link. The following test case shows that it is failing in IE7 when the link is added to the page dynamically:
comment:4 Changed 15 months ago by dmethvin
- Status changed from closed to reopened
- Resolution worksforme deleted
jQuery doesn't do that, IE does. We just put the text you asked for in .innerHTML and IE hoses it before we can get the real attribute. The only way around that would be to parse the entire HTML string into DOM ourselves and that ain't happening. oldIE is slow enough already.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

http://jsfiddle.net/timmywil/F5KZ2/