Skip to main content

Bug Tracker

Side navigation

#8481 closed bug (invalid)

Opened March 09, 2011 04:59AM UTC

Closed March 09, 2011 03:54PM UTC

Last modified March 14, 2012 06:31PM UTC

location.hash broken within jQuery after page redirection on IE

Reported by: arachnojoe@gmail.com Owned by:
Priority: undecided Milestone: 1.next
Component: unfiled Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:
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:

1. Land on a page via page redirection (previous page sets Location header).

2. Set window.location.hash from within a jQuery handler on this page.

3. 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.

Attachments (0)
Change History (2)

Changed March 09, 2011 06:58AM UTC by arachnojoe@gmail.com comment:1

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.

Changed March 09, 2011 03:54PM UTC by addyosmani comment:2

resolution: → invalid
status: newclosed

Closing as the original submitter has confirmed this is not an issue with core.