# Adding a javascript in a post?

**URL:** <https://meta.discourse.org/t/adding-a-javascript-in-a-post/130019>\
**Category:** Support\
**Created:** [October 2, 2019, 7:58am UTC](https://meta.discourse.org/t/adding-a-javascript-in-a-post/130019 "2019-10-02T07:58:50Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)\
**Post date:** [October 2, 2019, 8:38am UTC](https://meta.discourse.org/t/adding-a-javascript-in-a-post/130019/2 "2019-10-02T08:38:48Z")

</div>

You may need a plugin or at least a Theme Component.

JavaScript is not allowed in posts - can you imagine the potential mischief of allowing randoms to post javascript?

JavaScript is allowed in Theme Components (which are under the admin’s control) but that may not solve the whole problem.

Finally, because Discourse is built within the Ember framework, the exact order of despatch makes using random additional javascript scripts a little less predictable (hence why you may need a Theme Component or Plugin to integrate the code in the right way).

To post code you use three back ticks before and after. `

FYI [Amazon affiliate links work.](https://meta.discourse.org/t/incorporating-amazon-onelink-making-affiliated-links-on-global-forums-much-easier/93642) The javascript element is placed in a Theme Component and the link is placed in the post.

---

_[View the full topic](https://meta.discourse.org/t/adding-a-javascript-in-a-post/130019)._
