Bug Tracker

Modify

Ticket #8481 (closed bug: invalid)

Opened 2 years ago

Last modified 14 months ago

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:

  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

comment:1 Changed 2 years ago by arachnojoe@…

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 2 years ago by addyosmani

  • Status changed from new to closed
  • Resolution set to invalid

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

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.