$(function(){ }) vs $(document).ready(function() {})

Benchmark created by Rick Waldron on


Description

$(function(){ })

vs

$(document).ready(function() {})

Preparation HTML

<script src="https://code.jquery.com/jquery.js"></script>

Test runner

Ready to run.

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

Revisions

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