Bug Tracker

Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#6801 closed bug (duplicate)

jQuery.event.add() does not check against undefined handlers

Reported by: hyponiq Owned by:
Priority: undecided Milestone: 1.4.2
Component: event Version: 1.4.2
Keywords: event, handler Cc:
Blocked by: Blocking:


This is a cross browser issue:

jQuery.event.add() does not check whether 'handler' has been defined. An error is thrown (in (at least) all major browser) when properties of 'handler' are attempted be accessed on an undefined object.

Change History (4)

comment:1 Changed 13 years ago by hyponiq

I have, in my own copy of jQuery, fixed the issue (for brevity, irrelevant material replaced with "// ... rest ... //"):

jQuery.event = {
	// Bind an event to an element
	// Original by Dean Edwards
	add: function( elem, types, handler, data ) {
                // ... rest ... //
		// bug found where on certain occasions, 'hander' is undefined
		if ( handler === undefined ) {
                // ... rest ... //
        // ... rest ... //

comment:2 Changed 13 years ago by dmethvin

Can you provide a test case?

comment:3 Changed 12 years ago by Rick Waldron

Priority: undecided
Resolution: duplicate
Status: newclosed

comment:4 Changed 12 years ago by Rick Waldron

Duplicate of #7229.

Note: See TracTickets for help on using tickets.