Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

207
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda