Opened 12 years ago
Closed 12 years ago
#7852 closed bug (wontfix)
Problem of Adding same Event listener Hanlder
Reported by: | anonymous | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | 1.6 |
Component: | unfiled | Version: | 1.4.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
jQuery 1.4.2 line 1663-1664:
// Add the function to the element's handler list handlers.push( handleObj );
to
// Add the function to the element's handler list var handle_exists = false; for (var i = 0; i < handlers.length; ++i) { if (handlers[i].guid == handleObj.guid) { handle_exists = true; } } if (handle_exists == false) { handlers.push( handleObj ); }
I guess, This jQuery(>=1.4.2)'s problem is caused by changing type of handlers object to array, line 1639.
Change History (2)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
This is, unfortunately, intentional. The same handler can be bound multiple times with different eventData
.
Note: See
TracTickets for help on using
tickets.
The reason to post is I want to use jquery.hotkey.js with lastest jQuery. But I faced the problem with jQuery over 1.4.2 version.
sample problem code:
Opening this and pressing 'j' or 'k', JS console gets document.body three times. To suspend code to the last post one, JS console gets once.