Look at the following code:
window.onload = someFunction;
Many times I see the use of this kind of code and even I use the same. But, there
In this case, you are registering a callback function for the window onload event.  To do so, you give a reference to the function, you don't execute the function (unless, of course, executing the function returns another function which is used as the callback handler).  The function you specify will be executed when the onload event occurs, that is, when the page finishes loading.