I use a lot of jQuery, so I have to keep typing out the $(document).ready
function to put the jQuery code. Is there a shorter form of the function?
The three following syntaxes are allowed:
Syntax 1
$(document).ready(function)
Syntax 2
$().ready(function)
Syntax 3
$(function)
Update:
Additionally, from version 1.9 onwards:
$(window).on('load', null, function)
$(document).on('ready', null, function)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With