Different different type of call document ready

Different types of Document Ready functions typically used in jQuery

We call document.ready in many ways like below and they have same functionality and it is jQuery specific event.
//call type 1
$(document).ready(function() {
/** work when all HTML loaded except images and DOM is ready **/
// your code
});
 
//call type 2
$(function() {
/** work when all HTML loaded except images and DOM is ready **/
//your code
});
 
//call type 3
$(document).on('ready', function(){
/** work when all HTML loaded except images and DOM is ready **/
//your code
});
 
//call type 4
jQuery(document).ready(function(){
/** work when all HTML loaded except images and DOM is ready **/
//your code
});
Different different type of call document ready Different different type of call document ready Reviewed by Bhaumik Patel on 9:08 AM Rating: 5