Bug Tracker

Opened 10 years ago

Closed 10 years ago

#4268 closed bug (fixed)

Events bound to iframe windows bound to jQuery window instead

Reported by: tr4nslator Owned by: brandon
Priority: critical Milestone: 1.4
Component: event Version: 1.3.2
Keywords: iframe event Cc:
Blocked by: Blocking:

Description

An IE hack on line 2587 of 1.3.2 is preventing events from being bound on iframe windows:

if ( elem.setInterval && elem != window )
  elem = window;

This condition fires mistakenly for iframe windows, because they have the setInterval method but are not the main window.

This can be fixed easily changing this line to:

if ( elem.setInterval && ( elem != window && !elem.frameElement ) )
  elem = window;

As shown in the attached test cases.

Attachments (5)

jquery-1.3.2_after.js (118.0 KB) - added by tr4nslator 10 years ago.
Patched jQuery file
after.html (748 bytes) - added by tr4nslator 10 years ago.
File pointing to fixed jQuery
before.html (742 bytes) - added by tr4nslator 10 years ago.
File pointing to original jQuery
jquery-1.3.2.js (117.9 KB) - added by tr4nslator 10 years ago.
Original jQuery
ticket4268.patch (565 bytes) - added by tr4nslator 10 years ago.
Patch

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by tr4nslator

Attachment: jquery-1.3.2_after.js added

Patched jQuery file

Changed 10 years ago by tr4nslator

Attachment: after.html added

File pointing to fixed jQuery

Changed 10 years ago by tr4nslator

Attachment: before.html added

File pointing to original jQuery

Changed 10 years ago by tr4nslator

Attachment: jquery-1.3.2.js added

Original jQuery

Changed 10 years ago by tr4nslator

Attachment: ticket4268.patch added

Patch

comment:1 Changed 10 years ago by brandon

Resolution: fixed
Status: newclosed

fixed in 6316

Note: See TracTickets for help on using tickets.