#1925 closed bug (fixed)
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: | |
Blocked by: | Blocking: |
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 (1)
Change History (5)
Changed 15 years ago by
Attachment: | safari_window_load.patch added |
---|
comment:1 Changed 15 years ago by
comment:3 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 Changed 12 years ago by
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
Note: See
TracTickets for help on using
tickets.
As a test case, try:
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.