# Rerender on new route or transition

**URL:** https://meta.discourse.org/t/rerender-on-new-route-or-transition/68253
**Category:** Development
**Created:** [August 17, 2017, 4:54pm UTC](https://meta.discourse.org/t/rerender-on-new-route-or-transition/68253 "2017-08-17T16:54:45Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [August 12, 2021, 1:22pm UTC](https://meta.discourse.org/t/rerender-on-new-route-or-transition/68253/8 "2021-08-12T13:22:03Z")

</div>

When the “footer” is rendered in Discourse, the app sends an “event”

The event is `inserted-custom-html:footer`

You can use that event to update your footer content like so

```javascript
api.onAppEvent("inserted-custom-html:footer", () => {
  // add your JS here
});

```

There’s a few more details [here.](https://meta.discourse.org/t/javascripts-targeting-the-footer-doesnt-work-after-page-transitions/180012/4)

This should work for what you’re trying to achieve. If it doesn’t, let me know - and post the code you’re using.

---

_[View the full topic](https://meta.discourse.org/t/rerender-on-new-route-or-transition/68253)._
