Ticket #3577 (closed bug: invalid)
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: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.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

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.