[jQuery] Re: jQuery binding without chaining events?

2007-06-25 Thread Ganeshji Marwaha
as scott mentioned, i would strongly reading through the article. But, just for fun here is a simple hack that could be useful. $("#elem").unbind("click").bind("click", fnName); this will unbind all the click event handlers from the provided element, then bind ur new click event. this way you c

[jQuery] Re: jQuery binding without chaining events?

2007-06-25 Thread Scott Sauyet
SimonJanes wrote: How do I bind an event handler to an query with $().bind() without chaining the event-- what I want to do is set the event handler only if it wasn't already set for that matching element. I don't want that handler to be called twice (or three, four, etc times) for that event.