Help with js to insert into a topic



I need to insert <script src="https://xxxxx.js" async></script> into a topic, just ONE topic.

I knew this:

But it is possible to use javascript to check the url and if it match, insert the js? :thinking:


After typing this, an idea hit my head:

    <script type="text/javascript">
    if(window.location.href === "") {
    var head = document.getElementsByTagName('head')[0];
    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = 'https://xxxxxxx.js';

It’s working fine ! :+1: