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

136
Views
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 answers
Answer question

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 Report
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!