jQuery .live() vs .delegate() vs .on() (v38)

Revision 38 of this benchmark created on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js">
</script>
<div id="contesto">
  <p>
    test sugli eventi
  </p>
</div>

Test runner

Ready to run.

Testing in
TestOps/sec
.live()
$('p').live('click', $.noop);
ready
.live() con Contesto
$('p', $('#contesto')).live('click', $.noop);
ready
.delegate()
$('#contesto').delegate('p', 'click', $.noop);
ready
.delegate() nel Documento
$(document).delegate('p', 'click', $.noop);
ready
.on()
$('#contesto').on('click', 'p', $.noop);
ready
.on() nel Documento
$(document).on('click', 'p', $.noop);
ready
.click()
$('p').click($.noop);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.