I am trying to import the interactjs library from a cdn. It works if you add a script tag from the head. However I want to be able to load this library using JavaScript and bring it to scope.
example in the following codepen: https://codepen.io/ta32/pen/abLgyGW?editors=1111
script.type = "text/javascript";
script.src = "https://cdn.jsdelivr.net/npm/interactjs/dist/interact.min.js";
document.head.appendChild(script);
eval(script);
non of the techniques mentioned in the articled worked https://levelup.gitconnected.com/how-to-load-external-javascript-files-from-the-browser-console-8eb97f7db778
Is it an issue with this particular library?
I also tried importing it from the chrome console and it didn't work either. I think there should be a way to load third-party libraries and bring them into scope without having to add script tags in the head.