none
Microsoft Edge google fonts asynchronously , this code works on all other browsers, Except in in Edge. RRS feed

  • Question

  • /* This code works on all other browsers and loads the 800 + fonts, in Edge does not load anything, but if I limit the load to 300 fonts in the loop these are loaded, any idea? Is my fault? */
    
    var familiesArray = [];
                            $.each( lorem_ipsum.items, function(index, val){ //load google fonts asynchronously 
                                familiesArray.push(val.family);
                                //if (index < 300) familiesArray.push(val.family);
                                //if (index > 550) familiesArray.push(val.family);
                                //if (index > 100) return false;
                            });
                            
        /*                      lorem_ipsum.items.forEach(function(val, index){
                                familiesArray.push(val.family);
                            });
    */
        /*                  for ( var i = 0, len = lorem_ipsum.items.length; i < len; i++){
                                familiesArray.push(lorem_ipsum.items[i].family);
                            }
    */
                        WebFontConfig = {
                            google: {
                                families: familiesArray
                             },
                        };
                        (function(d) {
                            var wf = d.createElement('script'), s = d.scripts[0];
                            wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js';
                            wf.type = 'text/javascript';
                            wf.async = true;
                            s.parentNode.insertBefore(wf, s);
                        })(document);

    Wednesday, December 13, 2017 2:15 AM