Modify ↓
Ticket #8481 (closed bug: invalid)
location.hash broken within jQuery after page redirection on IE
| Reported by: | arachnojoe@… | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | 1.next |
| Component: | unfiled | Version: | 1.4.4 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
This is a weird bug that breaks location.hash. When all of the following circumstances are met, assigning a target to location.hash results in an error on Internet Explorer:
- Land on a page via page redirection (previous page sets Location header).
- Set window.location.hash from within a jQuery handler on this page.
- Load the page on IE7 or IE8 (at least on Vista).
Under these circumstances jQuery 1.4.4 works on all browsers I tested but IE. It works in Firefox and Chrome on Windows and in Safari and Chrome on OS X.
I can solve the problem simply by moving the window.location.hash assignment outside of a jQuery handler, such as by putting it directly in the onClick attribute of an element.
Change History
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.

Apologies, but further investigation showed that this is completely a function of page redirection and doesn't seem to have anything to do with jQuery. I don't see how to delete my ticket.