There is a load event on <body>, but it will already have fired by the time you add the listener in window.onload.
Using window.onload itself is fine: when that fires, you know the entire page has already loaded. The idea of $(document).ready() is that sometimes it can fire earlier than window.onload, which waits for all the page's resources (eg images) to load before firing.
How to detect the body content being loaded before window.onload fires is quite a complex story, which is why frameworks like jQuery hide it all under their own event. On modern browsers you can do it by listening for the DOMContentLoaded event. On some browsers such as IE there are some ugly browser-specific hacks to guess that the body content is loaded; on older browsers you have no choice but to fall back to window.onload.
There is a load event on <body>, but it will already have fired by the time you add the listener in window.onload.
Using window.onload itself is fine: when that fires, you know the entire page has already loaded. The idea of $(document).ready() is that sometimes it can fire earlier than window.onload, which waits for all the page's resources (eg images) to load before firing.
How to detect the body content being loaded before window.onload fires is quite a complex story, which is why frameworks like jQuery hide it all under their own event. On modern browsers you can do it by listening for the DOMContentLoaded event. On some browsers such as IE there are some ugly browser-specific hacks to guess that the body content is loaded; on older browsers you have no choice but to fall back to window.onload.