Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

198
Views
Cómo hacer que el navegador ejecute el código del módulo primero antes del texto normal/javascript

Cómo asegurarme de que la etiqueta del script se ejecute en el orden que defino y también sincrónicamente, porque en el módulo importaré algún otro módulo de forma remota y luego lo usaré.

 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <script defer="false" async="false" type="module"> // will have import some module remotely here as well console.log('one'); </script> <script defer="false" async="false" type="text/javascript"> console.log('two'); </script> <script defer="false" async="false" type="module"> console.log('three'); </script> <script defer="false" async="false" type="text/javascript"> console.log('four'); </script> </body> </html>

Salida de la consola:

 two four one three

Mi hallazgo es que el motor ejecutará todo el script de vainilla en orden primero y luego solo ejecutará el script del módulo en orden. ¿Cómo puedo cambiar este comportamiento?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!