title: How to load third-party javascript tag asynchronously which has document.write
body: <p>We give out a piece of javascript tags such as <code>&lt;script src="http://ours.com/some.js"&gt;&lt;/script&gt;</code> which site owners put on their site like <a href="http://example.com">http://example.com</a> and in this javascript tag we want to dynamically include a third-party js such as   which can have document.write in it, but of course if we try to include it by conventional method,</p>
  
  <pre><code>var script_tag = document.createElement('script');
  script_tag.type = 'text/javascript';
  script_tag.src="http://third-party.com/some.js";
  document.getElementById('target').appendChild(script_tag);
  </code></pre>
  
  <p>we get a warning from browser,</p>
  
  <blockquote>
    <p>Warning: A call to document.write() from an asynchronously-loaded
    external script was ignored.</p>
  </blockquote>
  
  <p>How do we get around this? Keep in mind, we don't really have control over third-party scripts so we can't change the logic in it. We are looking for some solution which can work across all browsers. </p>