Friday, November 13, 2009

jQuery live events can only bind once

I've been doing some more javascript on the side as of late, and I ran into a snag with jQuery.  It was an odd case of live events that didn't seem to be taking hold.  In addition, it only looked like it was happening on Chrome.  As always, it helps to read the docs.
 
Unlike .bind(), only a single event can be bound in each call to the .live() method.

That means that my overlapping live binding were getting overwritten, and that Firefox and Chrome were merely adding the events in different orders.  If it's not apparently in the docs, start looking in the code.  As an aside, I've heard that the JQuery code is a good example of great javascript code.  I don't understand a lot of what I saw.  Well, tip.  Been working on some other things on the side, and will reveal them in due time.

Posted via email from The Web and all that Jazz

No comments:

Post a Comment