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

137
Vistas
html/js Layer handling: Create new elements or move and reinitialize

I often build applications with ajax and many layers (to create/edit/delete different kind of content for example - or show message boxes or something). Some of this layers are much complex in html an js. but i keep asking my self whats the best way to handle the layer elements.

Sometimes i have a template and use cloneNode and sometimes i create the html structure with js (createElement) - depends on complexity. But what's the best way to close the layer?

  • move it to a hidden area/hide the layer and show again for reuse: it exists always only one layer but it's much work reinitialize the layer to clear all user input.
  • remove the layer elements and create new: less source of error by defined state for initialization but i don't know how the browser handels deleted elements in terms of performance and memory.

i've often build it in both ways but i never seen advantages or disadvantages in practice. So what's the best practice?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If your website is getting too massive, an <iframe> could be a viable solution depending on your application.

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