# Add javascript to a theme component

**URL:** <https://meta.discourse.org/t/add-javascript-to-a-theme-component/152480>\
**Category:** Development\
**Created:** [May 23, 2020, 7:36pm UTC](https://meta.discourse.org/t/add-javascript-to-a-theme-component/152480 "2020-05-23T19:36:57Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![sbernhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sbernhard/32/208186_2.png) [@sbernhard](https://meta.discourse.org/u/sbernhard)\
**Post date:** [May 24, 2020, 7:54am UTC](https://meta.discourse.org/t/add-javascript-to-a-theme-component/152480/2 "2020-05-24T07:54:45Z")

</div>

Got it working. Just added the JS (not minimized) into the common/header.html.

See [discourse-highlight-text/common/header.html at master · sbernhard/discourse-highlight-text · GitHub](https://github.com/sbernhard/discourse-highlight-text/blob/master/common/header.html)

Would be good if someone could document this behavior to the theme /component developer guide.

---

_[View the full topic](https://meta.discourse.org/t/add-javascript-to-a-theme-component/152480)._
