What's the different between these three events?
Which one loads before/after others?
<body>
<script type='text/javascript'>
$(document).ready(function(){
console.log('Document %s',+new Date());
});
$('body').ready(function(){
console.log('Body %s',+new Date());
});
$(window).ready(function(){
console.log('Window %s',+new Date());
});
</script>
<div>hello world</div>
</body>
Strange thing is that , they fires on the same order as I put them on code. For current example. document
one fires first and windows
one fires at the last.
p.s. I've read window.onload vs <body onload=""/> , window.onload vs document.onload and few others.