# Een embed toevoegen aan een Wix website voor commentaar

**URL:** https://meta.discourse.org/t/adding-an-embed-to-an-wix-website-for-commenting/264932
**Category:** Support
**Created:** [14 mei 2023 om 03:26 UTC](https://meta.discourse.org/t/adding-an-embed-to-an-wix-website-for-commenting/264932 "2023-05-14T03:26:22Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![ethanjs](https://avatars.discourse-cdn.com/v4/letter/e/df788c/32.png) [@ethanjs](https://meta.discourse.org/u/ethanjs)
#### Post date: [14 mei 2023 om 03:26 UTC](https://meta.discourse.org/t/adding-an-embed-to-an-wix-website-for-commenting/264932/1 "2023-05-14T03:26:22Z")

</div>

I have looked up most of the topics and videos regarding embedding discourse topics on a separate website and have been running into issues with this on a Wix website. All I get is an error saying : Refusal to connect

On the **embedding** page I have gone through and added the allowed Hosts for the website. I have the category selected and everything appears to be good.

I replaced the **EMBED\_URL** with the URL of the page to embedding on.

I replaced the **DISCOURSE\_USERNAME** with my Discourse username for creating the topic.

I **pasted the entire HTML code** into the HTML iFrame on my website. Yet it just doesn’t seem to work for some reason. No sure where I am going wrong.

* * *

Any idea on what I can do to fix this?

I saw one person mention JSON or RSS in a different topic but I have no clue how to go about the process. Has anyone successfully added a Discourse embed onto a separate website?

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [14 mei 2023 om 04:04 UTC](https://meta.discourse.org/t/adding-an-embed-to-an-wix-website-for-commenting/264932/2 "2023-05-14T04:04:10Z")

</div>

hi @ethanjs welcome to meta 👋

i’m not certain, but i don’t think you can embed Discourse content into an iframe.

my site uses the embed on our Discourse forum as the engine for the comments section of our parent site at the bottom of articles and it works quite well for us that way.

this discussion may help:

> [@Support embedding Discourse in an iframe](https://meta.discourse.org/t/support-embedding-discourse-in-an-iframe/50405/6):
>
> Not being a developer, this thread leaves me puzzled about what the conclusion is regarding embedding discourse in an IFRAME. When you say: This sounds to me like: problem solved, especially since - in my case - everything would not only be happening under the same domain but even on the same server. But my understaning is also that this is nevertheless [not supported](https://meta.discourse.org/t/discourse-not-shown-in-iframe/26970/5) and therefore not recommended for people like me. But why? If trusted domains can be specified?

---

<div class="post-metadata">

### Author: ![ethanjs](https://avatars.discourse-cdn.com/v4/letter/e/df788c/32.png) [@ethanjs](https://meta.discourse.org/u/ethanjs)
#### Post date: [14 mei 2023 om 04:07 UTC](https://meta.discourse.org/t/adding-an-embed-to-an-wix-website-for-commenting/264932/3 "2023-05-14T04:07:48Z")

</div>

@Lillinator Thank you for the quick response back!

I see. I think I saw someone mention that in one of the topics too where you can’t paste directly into a iFrame.

When I paste the code directly into the site Velo by Wix is gives me an error saying **“JSX expressions must have one parent element”.**

 ![image](https://global.discourse-cdn.com/meta/original/4X/5/d/8/5d8afb00559eab4e4d37067796bc8e6eefd93ed2.png)

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [14 mei 2023 om 04:10 UTC](https://meta.discourse.org/t/adding-an-embed-to-an-wix-website-for-commenting/264932/4 "2023-05-14T04:10:36Z")

</div>

that’s because you have a code error and you are trying to return two expressions when only one is allowed somewhere. post your code and let us have a look.

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [14 mei 2023 om 04:27 UTC](https://meta.discourse.org/t/adding-an-embed-to-an-wix-website-for-commenting/264932/5 "2023-05-14T04:27:14Z")

</div>

code should look like this i but with your posting username and the EMBED\_URL as the url of the site you are embedding to:

```javascript
<div id='discourse-comments'></div>
<meta name='discourse-username' content='DISCOURSE_USERNAME'>

<script type="text/javascript">
  DiscourseEmbed = {
    discourseUrl: 'https://community.alivemaps.com/',
    discourseEmbedUrl: 'EMBED_URL',
    // className: 'CLASS_NAME',
  };

  (function() {
    var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
    d.src = DiscourseEmbed.discourseUrl + 'javascripts/embed.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);
  })();
</script>

```

---

<div class="post-metadata">

### Author: ![ethanjs](https://avatars.discourse-cdn.com/v4/letter/e/df788c/32.png) [@ethanjs](https://meta.discourse.org/u/ethanjs)
#### Post date: [14 mei 2023 om 04:28 UTC](https://meta.discourse.org/t/adding-an-embed-to-an-wix-website-for-commenting/264932/6 "2023-05-14T04:28:29Z")

</div>

Is it possible to do a fragment? I tested this and it seemed to show different errors. But now it’s for ‘react’

 ![image](https://global.discourse-cdn.com/meta/original/4X/0/a/6/0a62bd7092f92744c14c387ca3ce427d156202f4.png)

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [14 mei 2023 om 04:39 UTC](https://meta.discourse.org/t/adding-an-embed-to-an-wix-website-for-commenting/264932/7 "2023-05-14T04:39:56Z")

</div>

you shouldn’t have to fragment it and that code should work as long as you have the EMBED\_URL and DISCOURSE\_USERNAME correct. maybe check over your allowed host paths and categories configuration again. 🤔 i don’t know anything about Velo by Wix.

---

<div class="post-metadata">

### Author: ![ethanjs](https://avatars.discourse-cdn.com/v4/letter/e/df788c/32.png) [@ethanjs](https://meta.discourse.org/u/ethanjs)
#### Post date: [14 mei 2023 om 04:48 UTC](https://meta.discourse.org/t/adding-an-embed-to-an-wix-website-for-commenting/264932/8 "2023-05-14T04:48:50Z")

</div>

Updated the following : EMBED\_URL & DISCOURSE\_USERNAME

For some reason without the fragment the whole coding gives an error. Like in the image at the first picture but now with the Updated info.

I went ahead and created a post over in the Velo forum to see if they might know where I’m going wrong

 ![image](https://global.discourse-cdn.com/meta/original/4X/d/f/d/dfd6a1cecb956750de06c1b95bb2a57e9137da31.png)

I would absolutely love to know how to get this to work. I mean, even without the commenting ability but to just connect each page to the forum would be awesome!

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [14 mei 2023 om 04:56 UTC](https://meta.discourse.org/t/adding-an-embed-to-an-wix-website-for-commenting/264932/9 "2023-05-14T04:56:19Z")

</div>

i take it you have read this: [Wix Editor: Embedding a Site or a Widget | Help Center | Wix.com](https://support.wix.com/en/article/wix-editor-embedding-a-site-or-a-widget#adding-an-embed)

it seems they load into iframes there.

---

<div class="post-metadata">

### Author: ![ethanjs](https://avatars.discourse-cdn.com/v4/letter/e/df788c/32.png) [@ethanjs](https://meta.discourse.org/u/ethanjs)
#### Post date: [14 mei 2023 om 04:57 UTC](https://meta.discourse.org/t/adding-an-embed-to-an-wix-website-for-commenting/264932/10 "2023-05-14T04:57:06Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/4X/e/2/7/e2769fd1de1e3843edfa2b6c2d879e652ea14b5b.png)

🥰 Love this^^^^ 🥰

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [14 mei 2023 om 04:58 UTC](https://meta.discourse.org/t/adding-an-embed-to-an-wix-website-for-commenting/264932/11 "2023-05-14T04:58:00Z")

</div>

yep that’s our site 🙂 thanks. i’m the admin of the Discourse forum, but not the site it’s embedding to.

yea i don’t see any error in your code so i wonder if it’s the wix site. it may be the other settings like allowed hosts and paths with wix. hopefully they can give you some assitance from their end or someone here may recognize your issue and be able to help. at the moment, i am not seeing why it isn’t working for you.

---

<div class="post-metadata">

### Author: ![ethanjs](https://avatars.discourse-cdn.com/v4/letter/e/df788c/32.png) [@ethanjs](https://meta.discourse.org/u/ethanjs)
#### Post date: [14 mei 2023 om 05:06 UTC](https://meta.discourse.org/t/adding-an-embed-to-an-wix-website-for-commenting/264932/12 "2023-05-14T05:06:23Z")

</div>

Yeah, I read through the Embed instruction. I also called the Wix support like 4 times. They directed me to their expert team but was sent to voicemail b/c they were too busy. Then, I got an email a few days ago.

I’ll likely respond to that email with additional details about the request.

_Sent them a message just now_

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [14 mei 2023 om 05:09 UTC](https://meta.discourse.org/t/adding-an-embed-to-an-wix-website-for-commenting/264932/13 "2023-05-14T05:09:16Z")

</div>

yea i suspect it’s because Discourse won’t load embeds into iframes.

> [@Support embedding Discourse in an iframe](https://meta.discourse.org/t/support-embedding-discourse-in-an-iframe/50405/7):
>
> Because it’s an extremely fragile configuration. Discourse expects to control the browser tightly as a JavaScript app. This is not a static 1996 era web page to be slapped in an \<iframe\> willy-nilly, it’s far more complex.

---

<div class="post-metadata">

### Author: ![ethanjs](https://avatars.discourse-cdn.com/v4/letter/e/df788c/32.png) [@ethanjs](https://meta.discourse.org/u/ethanjs)
#### Post date: [14 mei 2023 om 05:15 UTC](https://meta.discourse.org/t/adding-an-embed-to-an-wix-website-for-commenting/264932/14 "2023-05-14T05:15:39Z")

</div>

I think you’re right on that w/ the iFrame. I followed the instructions from the Admin\>Custom\>Embedding page. Attempted to alter & update it in every possible way I could think of.

iFrame is likely the root of the problem since it’s a javascript. I did notice that link you last sent has a section called “Custom Element” below the HTML & Embed a Site. Which I believe that’s probably what’s holding it up.

 ![image](https://global.discourse-cdn.com/meta/original/4X/7/3/9/73976cfcc0fa8e4b4d471eae7ecd33af2d3bfd37.png)

Thank you so much for all your help Lilly!

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [14 mei 2023 om 05:37 UTC](https://meta.discourse.org/t/adding-an-embed-to-an-wix-website-for-commenting/264932/15 "2023-05-14T05:37:54Z")

</div>

> [@ethanjs](#):
>
> Thank you so much for all your help Lilly!

you’re welcome @ethanjs but i’m sorry i wasn’t able to help you more. 🫤

---

<div class="post-metadata">

### Author: ![ethanjs](https://avatars.discourse-cdn.com/v4/letter/e/df788c/32.png) [@ethanjs](https://meta.discourse.org/u/ethanjs)
#### Post date: [14 mei 2023 om 05:41 UTC](https://meta.discourse.org/t/adding-an-embed-to-an-wix-website-for-commenting/264932/16 "2023-05-14T05:41:05Z")

</div>

All good, I’ll post back on here what I hear from the Wix support.

I’m guessing this is mainly just an issue among their website compared to something like Word Press. Seems like a common issue other Wix users have run into over the years without a clear solution.
