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

247
Vistas
Vanilla Javascript Document Write based on ScreenResize

I would like to know why document.write is not working based on screen resize funciton. Following is the code. Can anyone give me an explanation on this. Thanks in Advance

detectDevice=()=>{
    let ww = window.innerWidth;
    if(ww>500) {
        document.write("Its Large Device");
    }
    else {
        document.write("Its Small Device");
    }
}
detectDevice();
window.addEventListener("resize", detectDevice);
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Your code is using the wrong function: let ww = window.innerWidth; instead, use the following:

 let ww = screen.width;
about 4 years ago · Juan Pablo Isaza Denunciar
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