# "defer" in script tag not working

**URL:** <https://forum.freecodecamp.org/t/defer-in-script-tag-not-working/684380>\
**Category:** Curriculum Help\
**Created:** [April 8, 2024, 5:56pm UTC](https://forum.freecodecamp.org/t/defer-in-script-tag-not-working/684380 "2024-04-08T17:56:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![RenanMDP](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/renanmdp/32/114928_2.png) [@RenanMDP](https://forum.freecodecamp.org/u/RenanMDP)\
**Post date:** [April 8, 2024, 5:56pm UTC](https://forum.freecodecamp.org/t/defer-in-script-tag-not-working/684380/1 "2024-04-08T17:56:17Z")

</div>

Why doesn’t it work in FCC’s code editor?

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [April 8, 2024, 6:05pm UTC](https://forum.freecodecamp.org/t/defer-in-script-tag-not-working/684380/2 "2024-04-08T18:05:32Z")

</div>

because the code editor is an hack to make the html css and javascript work together from a mocked filesystem, not an actual filesystem. Instead of defer, you need to put the javascript script tag as last thing in the body tag

---

<div class="post-metadata">

**Author:** ![RenanMDP](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/renanmdp/32/114928_2.png) [@RenanMDP](https://forum.freecodecamp.org/u/RenanMDP)\
**Post date:** [April 8, 2024, 6:34pm UTC](https://forum.freecodecamp.org/t/defer-in-script-tag-not-working/684380/3 "2024-04-08T18:34:57Z")

</div>

Does FCC use VS Code as its editor in the back-end? Scrimba does as well and “defer” works there.

Really not a big fan of script tag inside body. I solved it by wrapping the entire js code in a window.load event function.

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [April 8, 2024, 7:10pm UTC](https://forum.freecodecamp.org/t/defer-in-script-tag-not-working/684380/4 "2024-04-08T19:10:49Z")

</div>

No, it doesn’t use VSCode in the back-end. The editor is all front-end

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [October 8, 2024, 7:11am UTC](https://forum.freecodecamp.org/t/defer-in-script-tag-not-working/684380/5 "2024-10-08T07:11:30Z")

</div>

Closed on October 8, 2024, 7:11am UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
