# Confused about remotely loaded javascript content

**URL:** https://meta.discourse.org/t/confused-about-remotely-loaded-javascript-content/171770
**Category:** Support
**Created:** [November 30, 2020, 6:07pm UTC](https://meta.discourse.org/t/confused-about-remotely-loaded-javascript-content/171770 "2020-11-30T18:07:54Z")
**Posts on this page:** 1
**Showing post:** 11

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [December 8, 2020, 7:43pm UTC](https://meta.discourse.org/t/confused-about-remotely-loaded-javascript-content/171770/11 "2020-12-08T19:43:19Z")

</div>

Discourse is a Single Page Application and all the page markup is create client-side via our EmberJS application.

Using direct DOM manipulation like `document.write` is in direct conflict with the whole thing and has a really low change of “just working”.

I’d recommend trying to adapt you ads system to use our [House Ads in the official Ad Plugin](https://meta.discourse.org/t/house-ads-in-the-official-ad-plugin/116715) system. Maybe you can have a single ad in the house ads inventory, and use the [page change hook](https://meta.discourse.org/t/developer-s-guide-to-discourse-themes/93648#heading--4-c-11) to contact the ad server and replace the ad with the response? Or maybe your ad system can write to the House Ads inventory directly via API?

---

_[View the full topic](https://meta.discourse.org/t/confused-about-remotely-loaded-javascript-content/171770)._
