Are deferred scripts executed before DOMContentLoaded event?
问题 Upon defer attirbute MDN says: This Boolean attribute is set to indicate to a browser that the script is meant to be executed after the document has been parsed, but before firing DOMContentLoaded . The defer attribute should only be used on external scripts. On DOMContentLoaded MDN also says: The DOMContentLoaded event is fired when the initial HTML document has been completely loaded and parsed, without waiting for stylesheets ... So DOMContentLoaded is fired before CSSOM is ready. This