0

The docs say:

The DOMContentLoaded event is fired when the initial HTML document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading.

But what does "loaded and parsed" mean? Does it mean that they've been painted on the screen?

Adam Zerner
  • 17,797
  • 15
  • 90
  • 156
  • Duplicate: http://stackoverflow.com/questions/2414750/difference-between-domcontentloaded-and-load-events – Etienne Martin May 05 '17 at 23:50
  • 1
    It's not a duplicate of that question. That question asks about the _difference_ between DOMContentLoaded and Load. My question is asking to clarify something about DOMContentLoaded. – Adam Zerner May 05 '17 at 23:52
  • 1
    Loaded means the data has been fully transfered from the server. Parsed means that the received data has been consumed and a DOM structure representative of the given markup has been generated. I don't know that it necessarily means that the browser has drawn anything, or that it would be required to do so. [Here's a quick test](https://jsfiddle.net/d3ut8tqa/) that has the `DOMContentLoaded` callback block for two seconds. Notice that the `foo` text doesn't appear until the handler has finished blocking (in Firefox anyway), so that indicates that it fires before the page is drawn. –  May 05 '17 at 23:59

1 Answers1

0

According to the Living Standard it is

Fired at the Document once the parser has finished

Which to me implies nothing has been drawn yet. Just that it has loaded the content so it can render the content. Although note that is is from a "non-normative" section, which means it is not binding.

Community
  • 1
  • 1
Jack
  • 20,735
  • 11
  • 48
  • 48