Opened 10 years ago
Closed 10 years ago
#14092 closed bug (notabug)
Error on triggering event on an element with no handlers.
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 2.0.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
on line 4691 there is :
4688: event.data = handleObj.data; 4689: event.handleObj = handleObj; 4690: 4691: ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) 4692: .apply( matched.elem, args );
In this line there is no check if handler exists. My solution to that is:
4688: event.data = handleObj.data; 4689: event.handleObj = handleObj; 4690: 4691: var tmp_handler = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ); 4692: if (typeof tmp_handler === 'function') { 4693: ret = tmp_handler.apply( matched.elem, args ); 4694: }
I noticed this in version 1.7.2 but it exists in all version up to date.
Change History (5)
comment:1 follow-up: 2 Changed 10 years ago by
Owner: | set to [email protected]… |
---|---|
Status: | new → pending |
comment:2 Changed 10 years ago by
Status: | pending → new |
---|
Replying to dmethvin:
Do you have an example of code that causes an error? Please create one in jsfiddle.
I'll give an example tomorrow at work.
comment:3 Changed 10 years ago by
Status: | new → pending |
---|
comment:4 Changed 10 years ago by
Status: | pending → new |
---|
I tried to reproduce this bug. but it may have been the result of too many recursions. I was passing events between two windows.
You can reject this ticket.
comment:5 Changed 10 years ago by
Resolution: | → notabug |
---|---|
Status: | new → closed |
Thanks for looking into it further.
Note: See
TracTickets for help on using
tickets.
Do you have an example of code that causes an error? Please create one in jsfiddle.