Ticket #8481 (closed bug: invalid)
location.hash broken within jQuery after page redirection on IE
|Reported by:||arachnojoe@…||Owned by:|
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.