In jQuery, is there any way to only bind a click once?

Posted by Chris Henry on Stack Overflow See other posts from Stack Overflow or by Chris Henry
Published on 2010-06-01T04:07:34Z Indexed on 2010/06/01 4:13 UTC
Read the original article Hit count: 169

Filed under:
|

I have an ajax app that will run functions on every interaction. I'd like to be able to run my setup function each time so all my setup code for that function remains encapsulated. However, binding elements more than once means that the handler will run more than once, which is obviously undesirable. Is there an elegant way in jQuery to call bind on an element more than once without the handler being called more than once?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery