Hello!!
I hope this will be of the interest of someone else: I’m trying to make a “social media feed” topic, in which I want to embed the widgets of different platforms so the users (and the admins!) can have a quick look at all of them in just one page, so they can remain within the forum, preventing the overload that means having to switch between so many social platforms just for quick updates (considering also that they usually share the same content), thus, increasing motivation to use the forum as a hub for the development of the comunity.
A nice widget generator I found is Woxo, which is clean and simple enough for the purpose. The problem now is that I’m unable to figure out how to embed the widget in the topic. I’m trying to see if there is some workaround with iframes or something like that, but I now wanted to ask to see if this is possible at all.
This is the code I get from Woxo for the instagram feed:
<div data-mc-src="f4b43a8f-c188-4f80-8206-36d9f7529f13#instagram"></div>
<script
src="https://cdn2.woxo.tech/a.js#616348fb53c1e8001686c619"
async data-usrc>
</script>
What I tried so far:
- Placing the
<script>
in the<body>
section,<footer>
and<header>
(I left it in header) - Ensuring the URL the script is coming from is whitelisted (https://cdn2.woxo.tech/ in this case)
- adding
defer
doesnt help (I’m keeping it just in case)
If I inspect the page, the script does appears at the bottom of the body section (inside), and since the source is whitelisted it should take effect. I checked if it could be my browser, but if I execute the HTML here Tryit Editor v3.7 it works perfectly fine.
I narrowed down the error to a specific function inside of the js script. The following call delivers a null value. It’s the only runtime error:
e=document.querySelector("div[data-mc-src]")
e is null
That div is written in the topic (the <div data-mc-src="f4b43a8f-c188-4f80-8206-36d9f7529f13#instagram"></div>
part). It remains as pure html code, so it should be readable. For some reason, the script fails to locate it.
With the defer
attribute, and in located in the footer, the scripts trows no error (that fact that it was trowing an error before proves that the URL of the js file is indeed whitelisted), so now I’m blindfolded on why it’s doing nothing.
Any input will be more that appreciated, thank you for your time in advance!
Lisandro
EDIT: finally I had to desist. Since only iframes are supported, I’m currently looking for a good web service that can provide one. Most of free services are too limited, paid versions are more than double the cost of the forum hosting service. Sorry for the whining, had to cry in loud voice here at not being able to just insert the free html code :’(