$(document).ready function VS $(window).load function

In this post I am going to tell you what is the difference between $(document).ready function and $(window).load function when ? and where they should be used?

Why do we use $(document).ready() at the top of our script?

Many of you might be wondering that way do we always use our javascript inside $(document).ready() in this Post i will tell you why do we use it and what if we don't write our script inside $(document).ready() function