title: which of these async loading methods is the best? document write?
body: <p>Is there difference between these two async JavaScript loading methods?</p>
  <pre class="lang-html prettyprint-override"><code>&lt;div class=&quot;g-plusone&quot;&gt;&lt;/div&gt;
  &lt;script type=&quot;text/javascript&quot;&gt;
      (function(d, t) {
          var g = d.createElement(t),
              s = d.getElementsByTagName(t)[0];
          g.async = true;
          g.src = 'https://apis.google.com/js/plusone.js';
          s.parentNode.insertBefore(g, s);
      })(document, 'script');
  &lt;/script&gt;
  
  &lt;script type=&quot;text/javascript&quot;&gt;
      //&lt;![CDATA[
      (function() {
          document.write('&lt;fb:like href=&quot;http://www.sandrophoto.com/' + location.pathname + '&quot; send=&quot;true&quot; width=&quot;360&quot; show_faces=&quot;false&quot; font=&quot;&quot;&gt;&lt;/fb:like&gt;');
          var s = document.createElement('SCRIPT'),
              s1 = document.getElementsByTagName('SCRIPT')[0];
          s.type = 'text/javascript';
          s.async = true;
          s.src = 'http://connect.facebook.net/en_US/all.js#xfbml=1';
          s1.parentNode.insertBefore(s, s1);
      })();
      //]]&gt;
  &lt;/script&gt;
  </code></pre>