# DOM 読み込み後の js 実行

**URL:** https://meta.discourse.org/t/executing-js-after-dom-loaded/102958
**Category:** Support
**Created:** [2018 年 11 月 28 日午前 9:03 UTC](https://meta.discourse.org/t/executing-js-after-dom-loaded/102958 "2018-11-28T09:03:55Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [2018 年 11 月 29 日午後 12:21 UTC](https://meta.discourse.org/t/executing-js-after-dom-loaded/102958/4 "2018-11-29T12:21:41Z")

</div>

What function does your button need to have? You should be able to use a plugin outlet:

> <https://github.com/discourse/discourse/blob/acd1693dac1bff6ff50250d942134bc48a27ff14/app/assets/javascripts/discourse/templates/components/topic-title.hbs#L5>

Check out [this section](https://meta.discourse.org/t/developer-s-guide-to-discourse-themes/93648#heading--4-b-1) in @Johani’s awesome guide for more on how to make use of them. Depending on the complexity of your button, you may need to use a widget.

---

_[View the full topic](https://meta.discourse.org/t/executing-js-after-dom-loaded/102958)._
