DEV Community

Discussion on: jQuery $(document).ready() in vanilla JavaScript

jonrandy profile image
Jon Randy • Edited on

Your event handler isn't doOnDocumentLoaded, rather it is an anonymous function that calls doOnDocumentLoaded - a rather unnecessary step when you could just usedoOnDocumentLoaded directly as the handler as I showed in my example

Thread Thread
andberry profile image
Andrea Berardi Author

And yes, you're totally right!
Sorry, and thank you so much!

I've just updated the gist!