Side navigation
#10837 closed bug (duplicate)
Opened November 19, 2011 09:25PM UTC
Closed November 22, 2011 12:29AM UTC
Last modified November 22, 2011 12:29AM UTC
Triggering custom events with the same name as a property fails
Reported by: | rv4wd | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.7 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
When triggering a custom event on an object which has a property with the same name, you get an error:
TypeError: Property 'custom' of object #<Document> is not a function
document.custom = 1; $(document).trigger('custom');
This makes it impossible to use custom events with property names on non-DOM-objects when there is a property with the same name:
var obj = {name: 'John Doe'}; $(obj).trigger('name');