Opened 11 years ago
Closed 11 years ago
#10905 closed bug (invalid)
JQuery Event Binding
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
JQuery is awesome. But I felt something missing I thought should suggest you. Whenever you create an event, and bind it to an element, say
$('.close').click(function(){...});
It works cool. But then when we create an element with the classname "close", the above created event is not attached to it. So anytime we create an element in the fly, we have to again attach the events to it. What I would suggest is to auto load/bind the existing events, like inheritance. And iff we want to change the event method, we can change it, like overloading. Let me know about this bug or feature. Take care
Change History (2)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Please see the .on()
and .delegate()
methods, and please use the forums unless you are reporting a bug.
JQuery is awesome. But I felt something missing I thought should suggest you. Whenever you create an event, and bind it to an element, say
$('.close').click(function(){...}); It works cool. But then when we create an element with the classname "close", the above created event is not attached to it. So anytime we create an element in the fly, we have to again attach the events to it. What I would suggest is to auto load/bind the existing events, like inheritance. And iff we want to change the event method, we can change it, like overriding. Let me know about this bug or feature. Take care