Add javascript widget (dynamic) to Wix page

Hello everyone,

I want to embed a widget from a third party. Unfortunately, the only thing I got was a code snippet of the following form:

<script src="https://somesite/widget-loader.js" async param1="value1" param2="value2"></script>

The issue is that the script tries to dynamically add DOM elements to the site, which does not seem to be allowed by Wix. There is also no placeholder

code or the like - only the above javascript code. The rest is all generated by the widget-loader.js script.

End result is that the widget fails to load. If I add the snippet as embedded Code in an iframe in the Wix website editor, the widget does not show up. However, if I then open the URL to the generated html file created by Wix on filesusr .com, and which contains said code, directly instead of via iframe embedding then the widget renders properly.

I have also already tried the Custom Element approach and generated the element within my Custom Element upon loading - no luck, still the widget does not show up, i.e. fails to alter the DOM of the final page.

So, is there a way to have a script-generated widget show up on the final/main Wix page?

Thx

Adding code to an HTML component is not a part of the Corvid product (which is what this forum is about). The basics of an HTML component is to put any HTML code in it. That code can be copied from any source that you want, but you need to know the exact code to put there (which is not related to Corvid )… You will need to check with the service provider to find out how to get it work.

A more secure way to handle web service requests is by using backend (server-side) code. Using backend code you can secure your passwords, API keys, and other secret information. The article Accessing 3rd Party Services explains how this is done. I recommend checking with the service provider to see if they provide a REST interface.