Dynamically added script will not execute

后端 未结 6 1484
囚心锁ツ
囚心锁ツ 2020-12-03 15:42

I am dynamically adding a script of a github gist. If I added it to the html before the page loads, the script will execute. But If I try to add it to the page after it load

6条回答
  •  爱一瞬间的悲伤
    2020-12-03 16:04

    So, as an alternative, I actually just stumbled upon a library which seems like it would handle this for you. Check out Injector.js, and it should work for you.

提交回复
热议问题