# Event Listeners for footer loaded

**URL:** <https://meta.discourse.org/t/event-listeners-for-footer-loaded/47929>\
**Category:** Development\
**Created:** [Julho 28, 2016, 4:48pm UTC](https://meta.discourse.org/t/event-listeners-for-footer-loaded/47929 "2016-07-28T16:48:47Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![travelvc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/travelvc/32/82090_2.png) [@travelvc](https://meta.discourse.org/u/travelvc)\
**Post date:** [Novembro 12, 2017, 10:25pm UTC](https://meta.discourse.org/t/event-listeners-for-footer-loaded/47929/7 "2017-11-12T22:25:15Z")

</div>

I had a similar requirement to know when the footer is rendered in JS.

I built live stats on my footer by putting together a few concepts:

- Add an event listener on document scroll to detect if a div in the footer exists, and record that we’ve seen it in a variable.
- Use Discourse.Route.reopen({ activate: function() { this.\_super(); … to invalidate the variable when new things load
- Cache my stats so I don’t keep refetching it

If I’m happy with this solution I’ll come back and post it.

---

_[View the full topic](https://meta.discourse.org/t/event-listeners-for-footer-loaded/47929)._
