mardi 28 août 2018

Google font loaded by webfontloader is render blocking

Sorry for my English first. Did i missed something? I use the following code to prevent render blocking contents:

WebFontConfig = {
    google: {
        families: ['Lato:300,300i,700']
    },
    active: function () {
        //document.querySelector('body').fadeIn(1000);
    },
};

(function () {
    var wf = document.createElement('script');
    wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
        '://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js';
    wf.type = 'text/javascript';
    wf.async = 'true';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(wf, s);
})();

No success speedtest complains render blocking fonts (async = true)... . I wonder if there is an alternative way to prevent this render blocking... .

Aucun commentaire:

Enregistrer un commentaire