Interviews - C# Corner

Nitin Choudhary
Can we add more than one ‘document.ready’ function in a page?
By Nitin Choudhary in JQuery onJan 20 2015
  • Shivam Shukla
    Feb, 2015 3

    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.

    • 2
  • Bidyasagar Mishra
    Jul, 2019 12

    yes

    • 0
  • Munesh Sharma
    May, 2016 4

    it is possible

    • 0
  • Suyambu Kesavan
    Jul, 2015 21

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

    • 0
  • Vaibhav Salwe
    May, 2015 30

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

    • 0
  • Neeraj Upadhyay
    May, 2015 27

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

    • 0
  • Kml Surani
    Apr, 2015 14

    No

    • 0
  • Pankaj  Kumar Choudhary
    Mar, 2015 27

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

    • 0
  • Shyam Narayan
    Mar, 2015 21

    yes u can.

    • 0
  • Navin Kumar
    Feb, 2015 27

    yes, you can

    • 0
  • chapala markandeyulu
    Feb, 2015 10

    Yes, we can

    • 0
  • Ganesh Saraf
    Jan, 2015 31

    Yes.It is possible

    • 0
  • birju gohel
    Jan, 2015 29

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

    • 0
  • birju gohel
    Jan, 2015 29

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

    • 0
  • Md. Raskinur Rashid
    Jan, 2015 28

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

    • 0
  • dotnet supt
    Jan, 2015 27

    Yes

    • 0
  • Nitin Choudhary
    Jan, 2015 20

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

    • 0

Most Popular Companies

Most Popular Job Functions

MOST LIKED QUESTIONS