Does jQuery live use setInterval?
Is the jQuery live
method using setInterval
to update the events?
Does this affect performance?
Based on this blog as a resource, it appears that jQuery.live() works by attaching the events to the document. Then, when an event is triggered (such as by a click), the event bubbles up to the document level - at which point it is compared against all the live event handlers. If it matches a live event handler, it fires the event for it.
This blog describes pretty well what's going on behind the scene.
http://www.neeraj.name/blog/articles/882-how-live-method-works-in-jquery-why-it-does-not-work-in-some-cases-when-to-use-livequery
live does not use setinterval but livequery does.
It seems it does NOT use SetInterval. I could be wrong.
精彩评论