# Using the 'Discourse' javascript class in a hosted forum

**URL:** <https://meta.discourse.org/t/using-the-discourse-javascript-class-in-a-hosted-forum/77704>\
**Category:** Product Support\
**Created:** [January 10, 2018, 10:00pm UTC](https://meta.discourse.org/t/using-the-discourse-javascript-class-in-a-hosted-forum/77704 "2018-01-10T22:00:43Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![garrettboatman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/garrettboatman/32/120397_2.png) [@garrettboatman](https://meta.discourse.org/u/garrettboatman)\
**Post date:** [January 11, 2018, 1:03am UTC](https://meta.discourse.org/t/using-the-discourse-javascript-class-in-a-hosted-forum/77704/3 "2018-01-11T01:03:42Z")

</div>

@simon - that’s exactly what I needed, thank you!

For future devs:

```
<script type="text/discourse-plugin" version="0.1">
  api.onPageChange((url, title) => {
    doSomething();
  });
</script>

```

^^ in the `</head>` Customize tab.

---

_[View the full topic](https://meta.discourse.org/t/using-the-discourse-javascript-class-in-a-hosted-forum/77704)._
