Bug Tracker

Modify

Ticket #942 (closed bug: worksforme)

Opened 6 years ago

Last modified 6 years ago

jQuery.unbind(element,"eventtype") not working in IE7

Reported by: jeffkretz@… Owned by:
Priority: major Milestone: 1.1.2
Component: event Version: 1.1.1
Keywords: unbind Cc:
Blocking: Blocked by:

Description

Using a debugger, I stepped through the code, and found the problem is here:

for ( var i in element.events[type] ) delete element.events[type][i];

In this specific case, the type was "mouseover", and there was only one event of that type. Rather than stepping through that code, it was completely skipped over. When I ran the command:

delete element.events[type];

This removed the event. So perhaps there is some problem with the javascript enumerator when there is only one element in a collection? Not sure.

Change History

comment:1 Changed 6 years ago by john

  • Version set to 1.1.1

Would it be possible to provide a more-complete example of this occurring? Does this error also occur in IE6?

comment:2 Changed 6 years ago by brandon

I am unable to reproduce this. Could you provide a test case?

comment:3 Changed 6 years ago by jeffkretz

I can only assume that I had something wrong in my original project, because I can't reproduce this error either. Perhaps I was running some additional script that conflicted with the jQuery event model.

This should be closed, sorry 'bout that. JK

comment:4 Changed 6 years ago by brandon

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

Glad it got worked out. Feel free to reopen the ticket if you are able to reproduce the issue.

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.