From one man who currently works on Google I saw code which looks similar to this:
$(document).bind('ready load', function() { ... });
There are 2 intertwined questions:
Since I'm only novice in JS, I don't understand the purpose of this binding. Why we need both
readyandload? I tend to think that sometimes we needready, sometimesload, but not both.Also, I tend to think that
readyis fordocument, andloadis forwindow. That's mean:$(document).ready(function() { ... }); $(window).load(function() { ... });But from the first snippet, it could be seen, that both
readyandloadare used fordocument. So, my assumption (readyis fordocument, andloadis forwindow) isn't correct?