Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

138
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda