a test fiddle
This is to try to see how old fiddles are listed... I think they deleted all my old fiddles for lack of login...
by Matt Rummler
HTML
<div>
this is a div
</div>
JavaScript
window.onload =()=>{console.log('This is a console log from window.onload');};
/*
These started to be changed ~ 2019.
Turns out for whatever odd reason, document.onload is deprecated.
Therefore, the above will work (though it seems to be frowned on), and 4 others may be customized but event handlers must be created with addEventListner (at the document level for sure but I assume at the window level as well??).
Valid "onload" event types for document:
>most things have loaded (just before DOMcontentLoaded fires): 'readystatechange'
>all deferred scripts have been downloaded and loaded: 'DOMcontentLoaded'
>after DOM content loaded, right before window.load, indicuates all sub-resources have been loaded: 'readystatechange' (test for document.readyState == 'interactive'):
>everything has been loaded (iframes, CSS, images... etc... everything): 'load'
See the links below for more details.
https://developer.mozilla.org/en-US/docs/Web/API/Document/readystatechange_event
https://developer.mozilla.org/en-US/docs/Web/API/Document/DOMContentLoaded_event
https://stackoverflow.com/questions/588040/window-onload-vs-document-onload/79586682#79586682
*/