jQuery#ready() (v2)

Revision 2 of this benchmark created on


Description

http://api.jquery.com/ready/

In addition to what’s being tested here, there’s $.ready too, but that one doesn’t actually do anything with functions, so it’s not a proper replacement for $(document).ready().

Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
$(document).ready(fn)
$(document).ready(function() {
  // some code
});
ready
$().ready(fn)
$().ready(function() {
  // some code
});
ready
$(fn)
$(function() {
  // some code
});
ready
$.fn.ready(fn)
$.fn.ready(function() {
  // some code
});
ready
$.ready(fn)
$.ready(function() {
  // some code
});
ready

Revisions

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