you-dont-need-jquery
you-dont-need-jquery copied to clipboard
replacement of document.ready
DOMContentLoaded
has been added in HTML5. So:
jQuery:
$(() => {
//...
});
Modern:
// HTML5
document.addeventListener('DOMContentLoaded', () => {
//...
});
// HTML4
document.onreadystatechange = function() {
if(document.readyState == 'complete') {
//...
}
};
:+1:
I will definitely get around to adding this in soon. Thanks.
In fact, there is also a replacement in HTML 4. I've updated it.