# JavaScript in Phoenix project

**URL:** <https://forum.elixirforum.com/t/javascript-in-phoenix-project/25577>\
**Category:** Questions\
**Tags:** phoenix, javascript, phoenix\_html\
**Created:** [September 22, 2019, 7:10pm UTC](https://forum.elixirforum.com/t/javascript-in-phoenix-project/25577 "2019-09-22T19:10:40Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![peerreynders](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/peerreynders/32/5826_2.png) [@peerreynders](https://forum.elixirforum.com/u/peerreynders)\
**Post date:** [September 22, 2019, 7:40pm UTC](https://forum.elixirforum.com/t/javascript-in-phoenix-project/25577/7 "2019-09-22T19:40:03Z")

</div>

Note that `DOMContentLoaded` will only fire if [`document.readyState`](https://developer.mozilla.org/en-US/docs/Web/API/Document/readyState) is still in the `loading` state. By the time it is set to `interactive` (or later `complete`) the `DOMContentLoaded` event has already been fired.

see

> **[Document: DOMContentLoaded event - Web APIs | MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document/DOMContentLoaded_event#Checking_whether_loading_is_already_complete)**
>
> The DOMContentLoaded event fires when the HTML document has been completely parsed, and all deferred scripts (

---

_[View the full topic](https://forum.elixirforum.com/t/javascript-in-phoenix-project/25577)._
