16
Reply

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

Nitin Choudhary

Nitin Choudhary

Jan 20, 2015
4.3k
0

    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.

    Shivam Shukla
    February 03, 2015
    2

    it is possible

    Munesh Sharma
    May 04, 2016
    0

    Yes, we can but it is not necessary to do.

    Suyambu Kesavan
    July 21, 2015
    0

    Yes. You can add unlimited document.ready on same page.

    Vaibhav Salwe
    May 30, 2015
    0

    yes we can add more than one document.ready function in our jquery part but they are called as there preference

    Neeraj Upadhyay
    May 27, 2015
    0

    No

    Kml Surani
    April 14, 2015
    0

    Yes we can add but normally and for the point of view of coding it is not necessary

    yes u can.

    Shyam Narayan
    March 21, 2015
    0

    yes, you can

    Navin Kumar
    February 27, 2015
    0

    Yes, we can

    chapala markandeyulu
    February 10, 2015
    0

    Yes.It is possible

    Ganesh Saraf
    January 31, 2015
    0

    no., But u add in java script function inside to used and add

    birju gohel
    January 29, 2015
    0

    no., But u add in java script function inside to used and add

    birju gohel
    January 29, 2015
    0

    Yes, we can. But no need to add and don't expect something special from it.

    Md. Raskinur Rashid
    January 28, 2015
    0

    Yes

    dotnet supt
    January 27, 2015
    0

    Yes, we can add more than one document.ready function in a page. But, body.onload can be added once in a page.

    Nitin Choudhary
    January 20, 2015
    0