jQuery .live() vs .click()

JavaScript performance comparison

Revision 43 of this test case created by Yogendra Gautam

Info

test jquery

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js">
</script>
<div id="context">
  <p>
    <a id="#test"> click me</a>
  </p>
</div>

Preparation code output

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
.live()
$('#test').live('click', function() {
  alert('me aahe')
});
pending…
.click
$('#test').click(function() {
  alert('me aahe');
});
pending…
.delegate()
$('#test').delegate('click', function() {
  alert('me aahe')
})
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment