Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

208
Visualizações
disable the css files containing font face and loading them when window load complete with jquery

Modified=(i want to remove css files containing fonts before they load in document, and when the document complete loading then i want to append those css files back into head so they will be ignored by google page speed insight, you can ignore the code i have written.)

i am trying to disable the fonts before they are loaded into document like removing the css file containing font faces at the document ready function, and when the document loading complete i want to append those css files back into head but the problem is i don't know. how to do this. i am trying to do this in wordpress so $ are replaced with jQuery and wordpress jquery is being used.

here is some code where i am trying to remove some css files and failing. its showing the url in consol log but not removing it. and the function to fetch css files containing font faces is out of my range. if somebody help me with it i will be really thankful.

jQuery(document).ready(function(){
        jQuery('link[href]').each(function(){
            let url = jQuery(this).attr('href');
            if(url === "//krannaken.com/wp-content/uploads/sgf-css/font-b8f04501e2566c46133fdd3b6c616a08.css"){
                console.log(url);
                jQuery(this).attr('href').remove();
            }
            if(url === "//krannaken.com/wp-content/uploads/sgf-css/font-40569607d7578b60739e8b9717f5c0b8.css"){
                jQuery(this).remove();
            }
            if(url === "//krannaken.com/wp-content/uploads/sgf-css/font-1b552e98c5836178863bfbc4ecd6aa9e.css"){
                jQuery(this).remove();
            }
            if(url === "//krannaken.com/wp-content/uploads/sgf-css/font-0ae462df9c069b6a3ad293ae791fb55c.css"){
                jQuery(this).remove();
            }
        });

});

even i am happy with if its in javascript

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda