JS window.onload Usage Vs Document
问题 window.onload from my reading sounds like it is loosely interchangeable with document.onload but my experience has shown this is incorrect. I've inherited a JS script and I'm not sure how to correct it. I want the JS to execute once the DOM has loaded, not once all resources have been loaded. How can I do this? Currently I have: window.onload = initDropMenu; I've tried: document.onload = initDropMenu; which just results in the menu not loading. I've also tried removing the line altogether