# Javascript added to theme header returns $ is not defined

**URL:** https://meta.discourse.org/t/javascript-added-to-theme-header-returns-is-not-defined/371370
**Category:** Development
**Created:** [June 23, 2025, 5:26pm UTC](https://meta.discourse.org/t/javascript-added-to-theme-header-returns-is-not-defined/371370 "2025-06-23T17:26:36Z")
**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: [June 23, 2025, 5:40pm UTC](https://meta.discourse.org/t/javascript-added-to-theme-header-returns-is-not-defined/371370/2 "2025-06-23T17:40:17Z")

</div>

Use native javascript, not jQuery.

(But even then be aware Discourse is a SPA PWA so you may have race conditions occuring if you are relying on certain elements having been rendered - and the solution to that is to use Ember Components rendered in specific plugin outlets in combination with modifiers)

---

_[View the full topic](https://meta.discourse.org/t/javascript-added-to-theme-header-returns-is-not-defined/371370)._
