Great article! I really liked how you broke down the code before refactoring it so it was easy to understand. I thought you were going to replace $('document').ready(... with window.onload()..., though - how is it different from document.readyState === 'complete'?
Great article! I really liked how you broke down the code before refactoring it so it was easy to understand. I thought you were going to replace
$('document').ready(...
withwindow.onload()...
, though - how is it different fromdocument.readyState === 'complete'
?Thanks for the comment @carlyraejepsenstan !
I don't think there was any real reason I used one over the other, might just have been the first link I chanced on while searching.
According to MDN and based on my understanding, they should be the same event.