# Understanding how embedding works on remote site

**URL:** <https://meta.discourse.org/t/understanding-how-embedding-works-on-remote-site/27781>\
**Category:** Support\
**Created:** [April 20, 2015, 10:22pm UTC](https://meta.discourse.org/t/understanding-how-embedding-works-on-remote-site/27781 "2015-04-20T22:22:48Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)\
**Post date:** [April 24, 2015, 8:11pm UTC](https://meta.discourse.org/t/understanding-how-embedding-works-on-remote-site/27781/5 "2015-04-24T20:11:18Z")

</div>

The code you embed tells discourse there’s a new post to embed. For example on [eviltrout.com](http://eviltrout.com):

```javascript
var discourseUrl = "http://fishtank.eviltrout.com/",
    discourseEmbedUrl = "http://eviltrout.com/2014/12/22/watch-ember-tv.html";
(function() {
  var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
  d.src = discourseUrl + 'javascripts/embed.js';
  (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);
})();

```

The first time that script is executed it contacts discourse and says "give me the contents for `discourseEmbedUrl`. Discourse will then say, hey, there are no comments, but in the background enqueue a job to crawl that page for its contents. So shortly afterwards, it will be crawled and run through readability.

The key is `discourseEmbedUrl`.

Your site will indeed break if `discourseEmbedUrl` changes. However, I assume the original URL still works even when it’s updated? If you leave `discourseEmbedUrl` as the original value it will not import the article twice and the comments will continue to work.

---

_[View the full topic](https://meta.discourse.org/t/understanding-how-embedding-works-on-remote-site/27781)._
