Sometimes you need to dynamically add a script tag to HTML. But there are some gotchas that might get you if you don't know to look out for them.

You might ask, why add scripts dynamically at all? Well, here's two reasons:

  1. When you don't know what to load until runtime.
  2. When you want to load scripts without blocking the page load.

I recently …

Read More