Their is mainly two differences 1.HTML Page can contain multiple $(document).ready(function(){}) but we cannot use $(document).onload(function(){}) more than one.
2.$(document).ready(function(){}) run when dom is ready. $(document).onload(function(){}) run when all the event defined on the Dom is bind.
Their is mainly two differences
ReplyDelete1.HTML Page can contain multiple $(document).ready(function(){}) but we cannot use $(document).onload(function(){}) more than one.
2.$(document).ready(function(){}) run when dom is ready.
$(document).onload(function(){}) run when all the event defined on the Dom is bind.