Bug Tracker

Modify

Ticket #1278 (closed bug: fixed)

Opened 6 years ago

Last modified 6 years ago

Triggering unhandled event causes js error

Reported by: dmethvin Owned by:
Priority: major Milestone: 1.1.3
Component: event Version: 1.1.2
Keywords: Cc:
Blocking: Blocked by:

Description

If there is an element #test that has no event handlers, then $("#test").trigger("anything here") causes an error because element.$handle isn't yet defined.

This fixed the problem for me:

 http://dev.jquery.com/browser/trunk/jquery/src/event/event.js#L151

< if ( (val = element.$handle.apply( element, data )) !== false )

> if ( jQuery.isFunction(element.$handle) && (val = element.$handle.apply( element, data )) !== false )

Attachments

scratch.htm Download (535 bytes) - added by dmethvin 6 years ago.
test case

Change History

Changed 6 years ago by dmethvin

test case

comment:1 Changed 6 years ago by brandon

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

Fixed in Rev [2136].

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.