jQuery Live VS On (v7)

Revision 7 of this benchmark created on


Description

.live() being deprecated post 1.9, switched to an earlier jquery that supports all three methods

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<div id="a_div"></div>

Test runner

Ready to run.

Testing in
TestOps/sec
Live
$('#a_div').live('click', function () {});
ready
On (similar to delegate)
$(document).on('click', '#a_div', function () {});
ready
On (similar to bind)
$('#a_div').on('click', function () {});
ready

Revisions

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