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

180
Vistas
inline and external scripts in the head affect parser

index.html:

<!DOCTYPE html>
    <html lang="en">
      <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
        <style>
          p {
            color: red;
          }
        </style>
        <script src="script.js"></script>
        <!-- <script>
          console.log('script 1 starts');
          for (let i = 0; i < 3e9; i++) {}
          console.log('script 1 ends');
        </script> -->
      </head>
      <body>
        <p>paragraph</p>
        <script src="script2.js"></script>
        <style>
          p {
            color: blue;
          }
        </style>
      </body>
    </html>

script.js:

console.log('script 1 starts');
for (let i = 0; i < 3e9; i++) {}
console.log('script 1 ends');

script2.js:

console.log('script 2 starts');
for (let i = 0; i < 3e9; i++) {}
console.log('script 2 ends');

When I run this HTML file in the browser what I see is:

  1. Long loading of a browser
  2. Blue colored paragraph

If I comment out external script in the and comment in inline then I see:

  1. Loading of a browser
  2. Red coloured paragraph
  3. Loading of a browser
  4. Blue colored paragraph Question: Why I don't see red coloured paragraph in the first scenario? Should it matter for parser if the script in the is inline or external?
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