/    Sign up×
Community /Pin to ProfileBookmark

determine if ‘live’ or ‘bind’ is used on element

Hi All

I have this odd situation in which a function receives an element that needs some cleanup; all events to which it is bind to should be removed
Unfortunately, I don’t know if the events are bind using ‘bind’ or ‘live’

Is it possible to use find this out somehow using only this element ?

cheers
Luca

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@DanInMANov 01.2011 — if you need to unbind events, just use unbind(), it wont matter of its a bind or a live
Copy linkTweet thisAlerts:
@jeanlucaauthorNov 01.2011 — I've tested that, and it doesn't work. I really have to use 'die' to unbind a 'live' event. This is also described here
Copy linkTweet thisAlerts:
@aj_nscNov 01.2011 — So use

$(elem).unbind().die() and you can remove all event handlers
Copy linkTweet thisAlerts:
@jeanlucaauthorNov 04.2011 — bind, unbind and live are deprecated now!

They solved this issue by using only one function: on()

@aj_nsc your solution works perfectly, but I think I switch to version 1.7! and use on() instead!
×

Success!

Help @jeanluca spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...