jQueryLiveVsOn

JavaScript performance comparison

Revision 3 of this test case created

Info

Este teste tem a finalidade de testar a diferença das funções live e on, sendo que a função live do jQuery foi depreciada.

Preparation code

<input type="button" id="btn_test" />
<link rel="stylesheet" href="//code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<script src="//code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="//code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>

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
Using live
$('#btn_test').live('vmouseup', function() {
  alert('Using Live.');
});
pending…
Using On
$('#btn_test').on('vmouseup', function() {
  alert('Using On.');
});
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