# テーマコンポーネントでスクリプトを再実行する方法

**URL:** <https://meta.discourse.org/t/how-to-re-execute-scripts-in-theme-components/191394>\
**Category:** Development\
**Created:** [2021 年 5 月 23 日午後 5:40 UTC](https://meta.discourse.org/t/how-to-re-execute-scripts-in-theme-components/191394 "2021-05-23T17:40:12Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![michaeld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michaeld/32/1594_2.png) [@michaeld](https://meta.discourse.org/u/michaeld)\
**Post date:** [2021 年 5 月 23 日午後 8:56 UTC](https://meta.discourse.org/t/how-to-re-execute-scripts-in-theme-components/191394/2 "2021-05-23T20:56:29Z")

</div>

```plaintext
<script type="text/discourse-plugin" version="0.8">
    api.onPageChange(() => {
        // あなたのコード
    });   
</script>

```

---

_[View the full topic](https://meta.discourse.org/t/how-to-re-execute-scripts-in-theme-components/191394)._
