# Embed forum topics with javarscript

**URL:** https://meta.discourse.org/t/embed-forum-topics-with-javarscript/298324
**Category:** Support
**Created:** [March 7, 2024, 7:12am UTC](https://meta.discourse.org/t/embed-forum-topics-with-javarscript/298324 "2024-03-07T07:12:58Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Benedek](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benedek/32/368786_2.png) [@Benedek](https://meta.discourse.org/u/Benedek)
#### Post date: [March 7, 2024, 7:12am UTC](https://meta.discourse.org/t/embed-forum-topics-with-javarscript/298324/1 "2024-03-07T07:12:58Z")

</div>

Hi!

I would like to embed some forum topics into our website. The [official](https://meta.discourse.org/t/embedding-a-list-of-discourse-topics-in-another-site/125911) way is working properly.

However when I try to embed the widget after some user interaction (in my case show widget only after cookie consent of the user) the official script won’t work anymore. The reason is that the [script](https://github.com/discourse/discourse/blob/b36256f222d056be6908da1fb608b2cef7c20e11/public/javascripts/embed-topics.js#L4) is waiting for the `DOMContentLoaded` event that is only fired once when the DOM is loaded (before the user interaction).

Do you have any support for this use case?

Thanks!
