Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does jQuery live use setInterval?

Tags:

jquery

live

Is the jQuery live method using setInterval to update the events?

Does this affect performance?

like image 777
jantimon Avatar asked May 23 '26 15:05

jantimon


2 Answers

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.

like image 68
Matt Avatar answered May 26 '26 07:05

Matt


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.

like image 37
Roger Avatar answered May 26 '26 06:05

Roger



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!