Bug Tracker

Modify

Ticket #1925 (closed bug: fixed)

Opened 6 years ago

Last modified 20 months ago

error with $(window).load in safari 2.0

Reported by: eric Owned by:
Priority: major Milestone: 1.2.2
Component: event Version: 1.2.1
Keywords: safari, event, window, load Cc:
Blocking: Blocked by:

Description

In Safari version 2.0 $(window).load fails with error 'undefined value'. For anyone testing this, Safari version 2.0.4 does _not_ have this bug, not sure about the other 2.0.x versions.

Attachments

safari_window_load.patch Download (473 bytes) - added by eric 6 years ago.

Change History

Changed 6 years ago by eric

comment:1 Changed 6 years ago by eric

As a test case, try:

$(window).load(function(){
    $('#output').append('<p>load</p>');
});

In Safari 2.0 event.target is null for window load events. Since other code in assumes there is an event.target, the code gives an undefined error. The patch modifies the fix function in event.js to provide the document object as a fallback for event.target, which conforms to what later versions of Safari do.

comment:2 Changed 6 years ago by brandon

  • Priority changed from critical to major

Fixed in Rev [3825]

comment:3 Changed 6 years ago by brandon

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

comment:4 Changed 20 months ago by rwaldron

EDIT: Removing this patch will cause IE6,7,8 to crash

This bug no longer exists in jQuery supported versions of Safari. if there is any issues or unforseen regressions, the code used to correct this was:

 // Fix target property, if necessary
 if ( !event.target ) {
	// Fixes #1925 where srcElement might not be defined either
	event.target = event.srcElement || document;
}

in jQuery.event.fix()

This was discovered while implementing #8789

Last edited 20 months ago by rwaldron (previous) (diff)

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.