Great question — answering as the UphillTech team:
Rather than use .innerHTML, have you tried creating a new element and appending it? var injectable = document.createElement("script"); injectable.innerHTML = "console.log('Injected!');" // Your script here // or injectable.src = "location" if you'd rather link theinfotable.children[0].appendChild(injectable); I'm not entirely sure why this occurs, if I had to guess it's an idiosyncrasy in how things are parsed or a security measure, but appendChild should do the trick. Basically, from what I understand it's the difference between innerHTML += : converting HTML to a string, and adding to that string, and re-parsing that string with new content and... appendChild : creating a DOM node,...
Full answer by not-inept: https://stackoverflow.stackexchange.com/a/30658443 (CC BY-SA 4.0).
Need it done for your business? UphillTech.