Bug Tracker

Modify

Ticket #3577 (closed bug: invalid)

Opened 5 years ago

Last modified 5 years ago

Event binding with namespace fails

Reported by: das-peter Owned by: brandon
Priority: major Milestone: 1.3
Component: event Version: 1.2.6
Keywords: event namespace binding Cc: das-peter
Blocking: Blocked by:

Description

On FF3 the binding of events together with a namespace fails.

The events are registered but the namespace is lost.

The error happens in the jQuery.js on line 1871.

Code:

 // Namespaced event handlers
 var parts = type.split(".");
 type = parts[0];
 handler.type = parts[1];

This part fails: handler.type = parts[1];

The type is not registered correctly. If you check it in firebug with console.log(handler.type); it seems correct, but if you check later events[type][handler.guid] firebug displays the object and the parameter "type" - but the parameter is undefined. Same thing happens then in the unbind() method and so the namespace is "useless" (for example the reacitvate of the links after close a modal ui.dialog fails)

A workaround for that issue is this:

 handler = jQuery.extend(handler,{ type: parts[1] });

I think this Overhead generates some overhead, so better fix would be nice.

Cheers, Peter

(Maybe the following ticket is related to this:  http://dev.jquery.com/ticket/3462 )

Change History

comment:1 Changed 5 years ago by flesler

  • Cc das-peter added
  • need changed from Patch to Test Case

That works regularly. Something must be interfering. Can you provide a test case ? a minimalistic html file with the requires html and js to reproduce the problem.

comment:2 Changed 5 years ago by das-peter

Hi flesler,

you're right. I've tested it again using a example as minimalistic as possible and it works like a charm. The issue happend in a prototyping environment - which has a lot of other libraries. (May you know the liferay portal framework, which uses jQuery.) I'll try to figure out as soon a possible which lib is interfering jQuery.

comment:3 Changed 5 years ago by flesler

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

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.