Skip to main content

Bug Tracker

Side navigation

#7089 closed bug (invalid)

Opened September 27, 2010 01:25PM UTC

Closed October 03, 2010 07:11PM UTC

Last modified August 31, 2011 06:56AM UTC

handleobj is undefined

Reported by: mrbrdo Owned by:
Priority: undecided Milestone: 1.4.3
Component: event Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:
Description

production version error = u is undefined.

The problem occured to me when calling .load on an img element. The img element was then removed and added again (with same id) and the .load event added again - this time I got the error. So not the first time but the second. Tested in Firefox and some other browsers aswell.

The fix is easy:

on line 1737 change

if ( all || namespace.test( handleObj.namespace ) ) {

to

if ( handleObj && (all || namespace.test( handleObj.namespace )) ) {

Error goes away, everything is ok.

Attachments (0)
Change History (6)

Changed September 27, 2010 02:24PM UTC by john comment:1

component: unfiledevent
resolution: → invalid
status: newclosed

Do you have a simplified test case for this? I'm not entirely sure what you're referring to.

Changed October 03, 2010 04:40PM UTC by mrbrdo comment:2

resolution: invalid
status: closedreopened

I cannot simplify it, but here is the problematic example:

http://www.mrbrdo.net/tmp/jquery-bug/index.htm

Click on a thumbnail image at the bottom. The first time this will work ok, but the second time (e.g. click another thumbnail after that), the error will be thrown.

If that line is changed in jquery which I mentioned above, the error goes away (not sure if it is the proper fix though).

Relevant code is in the gallery.js file.

Changed October 03, 2010 07:11PM UTC by dmethvin comment:3

resolution: → invalid
status: reopenedclosed

This is most likely due to modifying Object.prototype, I saw an instance of that in ./index_files/json.js included by your page.

Changed February 18, 2011 06:18AM UTC by me@tobiascohen.com comment:4

I just had this same error in 1.5 (after calling .remove()), and the proposed fix works. Yes, I had extended Object.prototype - is this a situation where jQuery is supposed to fail?

Changed February 18, 2011 01:00PM UTC by jitter comment:5

_comment0: Replying to [comment:4 me@…]: \ > I just had this same error in 1.5 (after calling .remove()), and the proposed fix works. Yes, I had extended Object.prototype - is this a situation where jQuery is supposed to fail? \ '''Modifying Object.prototype is verboten''' that as all kinds of negative side effects and jQuery is not supported on pages where other code messes with Object.prototype.1298034053185362

Replying to [comment:4 me@…]:

I just had this same error in 1.5 (after calling .remove()), and the proposed fix works. Yes, I had extended Object.prototype - is this a situation where jQuery is supposed to fail?

Modifying Object.prototype is verboten. As it has all kinds of negative side effects. jQuery is not supported on pages where other code messes with Object.prototype.

Changed August 31, 2011 06:56AM UTC by vladnicula@gmail.com comment:6

I found the same error on line 2744 in jquery.1.6.2.js when destroying the second time an item with the same Id when using jasmine BDD for JavaScript.

I added a handlerObj !== undefined to escape this error.