Hi I'm new to jQuery and I would like to know the difference between:
$(function() { });
and
$(document).ready(function() { });
Thanks!!
Hi I'm new to jQuery and I would like to know the difference between:
$(function() { });
and
$(document).ready(function() { });
Thanks!!
The first notation :
$(function(){ ... });
is short-hand for the second-choice :
$(document).ready(function(){ ... });
They will both do the exact same thing, however the first will just require slightly less code.
no difference - just different notation