9

According to the MDN wiki, DOMContentLoaded will fire when "page's DOM is ready, [although] the referenced stylesheets, images, and subframes may not be done loading."

What about DOMContentReady? Is it just an alias?

Bergi
  • 630,263
  • 148
  • 957
  • 1,375
seriousdev
  • 7,519
  • 8
  • 45
  • 52
  • 1
    `DOMContentReady`? Is that a real event type? Source please. – Šime Vidas Aug 05 '12 at 14:54
  • Take a look at this: https://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/extensions/options.html?view=markup&pathrev=148936 – seriousdev Aug 05 '12 at 15:01
  • Is that code your only source? If yes, it might be a typo. – Šime Vidas Aug 05 '12 at 15:09
  • It is also used all over [this question](http://stackoverflow.com/q/2024018/1048572) - but no link to a spec or such. – Bergi Aug 05 '12 at 15:14
  • Apart from that, there is a [`readyStateChange` event](https://developer.mozilla.org/en-US/docs/DOM/document.onreadystatechange) – Bergi Aug 05 '12 at 15:16
  • @Bergi I think the participants of that thread just mistook it for the actual "DOMContentLoaded" event type. – Šime Vidas Aug 05 '12 at 15:25
  • @ŠimeVidas It's not a typo; the commit that introduced this code [has been peer-reviewed](https://chromiumcodereview.appspot.com/10824073). If you still don't believe me, just google `DOMContentReady`. – seriousdev Aug 05 '12 at 15:34
  • 1
    @seriousdev Peer-review is done by humans, and is therefore subject to mistakes. Google gives 4400 results which all seem to be pointing to user discussions, with no results pointing to actual documentation. I reason that it's a typo or a *lapsus memoriae*. – Šime Vidas Aug 05 '12 at 15:43

2 Answers2

12

I'm making the claim that the event type "DOMContentReady" does not exist in current implementations (meaning, that no current implementation fires such an event type), and that appearances of such a name are merely lapsus memoriae.

The name "DOMContentLoaded" is not easily remembered, and since the jQuery library uses the method .ready() to bind this event type, I guess, some people just mistakenly used the name "DOMContentReady" to refer to the correct name "DOMContentLoaded".

Šime Vidas
  • 182,163
  • 62
  • 281
  • 385
0

As far as I know DOMContentReady is not a standard event. Just stick with DOMContentLoaded.

Cecchi
  • 1,525
  • 9
  • 9