16
Reply

Can we add more than one ‘document.ready’ function in a page?

Nitin Choudhary

Nitin Choudhary

10y
4.3k
0
Reply
    Yes we can do it as like I did in below example both the $(document).ready will get called, first come first served. In below code you will be cleared.$(document).ready(function(){$("#page-title").html("Document-ready was called!");}); $(document).ready(function(){$("#page-title").html("Document-ready 2 was called!");}); Output: Document-ready 2 was called!So in short we can add more than one 'document.ready' function in a page, but for a good programmer it is not advisable.
    it is possible
    Yes, we can but it is not necessary to do.
    Yes. You can add unlimited document.ready on same page.
    yes we can add more than one document.ready function in our jquery part but they are called as there preference
    No
    Yes we can add but normally and for the point of view of coding it is not necessary
    yes u can.
    yes, you can
    Yes, we can
    Yes.It is possible
    no., But u add in java script function inside to used and add
    no., But u add in java script function inside to used and add
    Yes, we can. But no need to add and don't expect something special from it.
    Yes
    Yes, we can add more than one document.ready function in a page. But, body.onload can be added once in a page.