# How to add JavaScript to post?

**URL:** <https://forum.ghost.org/t/how-to-add-javascript-to-post/19984>\
**Category:** Developer help\
**Created:** [February 5, 2021, 9:33am UTC](https://forum.ghost.org/t/how-to-add-javascript-to-post/19984 "2021-02-05T09:33:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![adoc](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/adoc/32/11164_2.png) [@adoc](https://forum.ghost.org/u/adoc)\
**Post date:** [February 5, 2021, 9:33am UTC](https://forum.ghost.org/t/how-to-add-javascript-to-post/19984/1 "2021-02-05T09:33:42Z")

</div>

Hi,

I have a folder that consists of an index.html, a script.js and some images that get called by the script.js. Is it possible to somehow embed/include this JavaScript “project” in a Ghost post? When I embed the CodePen code it shows the editor view on the published post page. This is not what I want.

I self-host and have access to the files via Cyberduck.

Thanks.

---

<div class="post-metadata">

**Author:** ![John](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/john/32/29288_2.png) [@John](https://forum.ghost.org/u/John)\
**Post date:** [February 6, 2021, 5:03am UTC](https://forum.ghost.org/t/how-to-add-javascript-to-post/19984/2 "2021-02-06T05:03:46Z")

</div>

Sure, you can use an HTML card inside the editor, with `<script>` tags - or you can add the script via Code Injection → inside the Post Settings Menu (settings cog in the top right)

---

<div class="post-metadata">

**Author:** ![adoc](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/adoc/32/11164_2.png) [@adoc](https://forum.ghost.org/u/adoc)\
**Post date:** [February 6, 2021, 5:54am UTC](https://forum.ghost.org/t/how-to-add-javascript-to-post/19984/3 "2021-02-06T05:54:28Z")

</div>

Thanks, John. Made it work. Such scripts do not get loaded in emails to subscribers though, do they?

---

<div class="post-metadata">

**Author:** ![John](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/john/32/29288_2.png) [@John](https://forum.ghost.org/u/John)\
**Post date:** [February 6, 2021, 6:20am UTC](https://forum.ghost.org/t/how-to-add-javascript-to-post/19984/4 "2021-02-06T06:20:05Z")

</div>

That’s correct - email clients don’t support embedded scripts
