title: Vuejs 2: How to include (and run) a script tag javascript file in the DOM dynamically?
body: <p>I am using Vuejs and I need to insert script tags in the DOM dynaically to embed JWPlayer videos in this way:</p>
  
  <pre><code>&lt;body&gt;
   &lt;!-- HTML content --&gt;
   &lt;script src="//content.jwplatform.com/players/KZVKrkFS-RcvCLj33.js"&gt;&lt;/script&gt;
   &lt;!-- More HTML content --&gt;
   &lt;script src="//content.jwplatform.com/players/ANOTHER-ID-ANOTHER-PLAYERID.js"&gt;&lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>I have used without results: <strong>v-html</strong> directive to render the html tags. As well <strong>v-bind:src</strong> but neither execute the code. I found this solution but it did not work either: <a href="https://stackoverflow.com/questions/45047126/how-to-add-external-js-scripts-to-vuejs-components">How to add external JS scripts to VueJS Components</a></p>
  
  <p>I used this solution but the script tags (one for each video) must be inserted in the body (not in head): they should create div tags containers and embed the videos. The problem is that the embeded JWPlayer file contains a document.write() statement. And the browser console says: <strong>"A call to document.write() from an asynchronously-loaded external script was ignored."</strong></p>
  
  <p>Is there anyway to achieve this?</p>