2
Reply

When does $document.ready function called in web page?

    $(document).ready(function(){// ... });This itself states that is a function to be called when the DOM (document) is ready to be rendered. This does not wait for content / page to be loaded. In order to run a function after window / page content is loaded, you need to use $(window).load(function(){});document ready function can be written multiple times with various functions or executions inside it, However, window load function can only be written once.

    This function is called once the web page is completely loaded and the DOM is ready (all the objects in the page is ready).