Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#8481 closed bug (invalid)

location.hash broken within jQuery after page redirection on IE

Reported by: [email protected] 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.

Change History (2)

comment:1 Changed 12 years ago by [email protected]

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.

comment:2 Changed 12 years ago by addyosmani

Resolution: invalid
Status: newclosed

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

Note: See TracTickets for help on using tickets.