# \[newbie\] Trouble adding script to dynamically change CSS values based on conditions

**URL:** https://meta.discourse.org/t/newbie-trouble-adding-script-to-dynamically-change-css-values-based-on-conditions/51386
**Category:** Support
**Created:** [October 11, 2016, 7:48am UTC](https://meta.discourse.org/t/newbie-trouble-adding-script-to-dynamically-change-css-values-based-on-conditions/51386 "2016-10-11T07:48:35Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [October 11, 2016, 8:01am UTC](https://meta.discourse.org/t/newbie-trouble-adding-script-to-dynamically-change-css-values-based-on-conditions/51386/2 "2016-10-11T08:01:44Z")

</div>

Yes, Discourse uses internal navigation, so the DOM will only be ready once.

@cpradio suggested a possible solution here:

> [@My plugin codes runs just once!(My own script shouldn't be cached)](https://meta.discourse.org/t/my-pluggin-codes-runs-just-once-my-own-script-shouldnt-be-cached/51301):
>
> Hi. I wrote a plugin and I run my code. my code run just for the first page of my website.even if it is a simple alert.for example if you open front page and go to categories page the alert doesn’t work on new page.

---

_[View the full topic](https://meta.discourse.org/t/newbie-trouble-adding-script-to-dynamically-change-css-values-based-on-conditions/51386)._
