classList.js icon indicating copy to clipboard operation
classList.js copied to clipboard

classList.js does not work if loaded after DOMContentLoaded

Open tmb-github opened this issue 8 years ago • 1 comments

I defer all of my JavaScript until after DOMContentLoaded. The classList.js polyfill is not accessible unless it is loaded at or before document.readyState === "loading". How can this be overcome?

tmb-github avatar Jun 14 '17 15:06 tmb-github

you can do smth like this at the bottom of the body of your page:

loadJS("./polyfills.js",loadJS("./bundle.js"));

see here

DOMContentLoaded is tricky: see here

englishextra avatar Jun 14 '17 16:06 englishextra