Is the jQuery live
method using setInterval
to update the events?
Does this affect performance?
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.
I cannot tell you about how it effects performance, but JQuery uses setInterval and setTimeout only when referencing onreadystatechange, which is directly related to its ajax calls and testing to see if the response has yet occurred.
This blog describes pretty well what's going on behind the scene.
live does not use setinterval but livequery does.