• Hello,

    In order to speed up the loading of this javascript, it is recommended to load it asynchronously.
    In file twitter-widgets.js, I added this extra line

    js.async = true;

    So the full code gives this :

    /*!
     * Twitter Embeddable Widget
     * https://dev.twitter.com/web/javascript/loading
     */
    window.twttr = (function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0],
        t = window.twttr || {};
      if (d.getElementById(id)) return t;
      js = d.createElement(s);
      js.id = id;
      js.async = true;
      js.src = "https://platform.twitter.com/widgets.js";
      fjs.parentNode.insertBefore(js, fjs);
    
      t._e = [];
      t.ready = function(f) {
        t._e.push(f);
      };
    
      return t;
    }(document, "script", "twitter-wjs"));

    Can you update the plugin with this feature request ?

    Thanks a lot.

  • The topic ‘Add async to avoid js blocking’ is closed to new replies.