Bug Tracker

Modify

Ticket #6869 (closed bug: duplicate)

Opened 3 years ago

Last modified 3 years ago

.one() method throws error with plain Javascript object

Reported by: Christopher Owned by:
Priority: Milestone: 1.4.2
Component: event Version: 1.4.2
Keywords: one bind trigger event Cc:
Blocking: Blocked by:

Description

With jQuery JavaScript Library v1.4.2 of Sat Feb 13 22:33:48 2010 -0500 on  http://code.jquery.com/jquery-1.4.2.js

I bind a event with ".one()" methode ( http://api.jquery.com/one/). And when trigger send an event. The methode handler is never called.

Attachments

testjs.html Download (736 bytes) - added by Christopher 3 years ago.
code

Change History

Changed 3 years ago by Christopher

code

comment:1 Changed 3 years ago by dmethvin

Thank you for the test case, I was able to reproduce the problem. The issue is that .one() is trying to unbind the event on the plain Javascript object. That ends up as a call to object.removeEventListener which doesn't exist.

We don't run into this problem with adding the event because jQuery.event.add checks the element itself to see if it supports addEventListener/attachEvent and since it supports neither it does nothing there.

comment:2 Changed 3 years ago by dmethvin

  • Summary changed from .one() methode don't function any more to .one() method throws error with plain Javascript object

comment:3 Changed 3 years ago by dmethvin

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

This is fixed in the nightlies, dup of #6184.

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.