jQuery: The Write Less, Do More JavaScript Library

Ticket #1925 (closed bug: fixed)

Opened 6 months ago

Last modified 6 months ago

error with $(window).load in safari 2.0

Reported by: eric Assigned to: anonymous
Type: bug Priority: major
Milestone: 1.2.2 Component: event
Version: 1.2.1 Keywords: safari, event, window, load
Cc: Needs: Review

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 (473 bytes) - added by eric 6 months ago.

Change History

Changed 6 months ago by eric

Changed 6 months 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.

Changed 6 months ago by brandon

  • priority changed from critical to major

Fixed in Rev [3825]

Changed 6 months ago by brandon

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.