简体   繁体   中英

Hidden HTML element or dynamically created in JavaScript

What's best practice?

I have number of windows in page. Auth, Execution Result, Popups.

I can show it two ways:

  1. Create during HTML load in pure html with css, set it to display: none and than fadeIn through jQuery ie

  2. Create element when it needed with jQuery, still in display: none mode and than show it through same fadeIn ie

So questions:

  1. What will be faster?
  2. What will consume less memory?
  3. What's best if I have some popup that will show only once?
  4. What's best if I have some popup that will show many times?
  5. Is there third way?

I'm not web programmer and looking for best practice. And if there is some site with such best practices?

Here i have some idea you can try

The HTML page you can click one link, when user click the link it will open modal dialog or new page that page you can write your window opening for new pages code.. so this case when user click the link it will open new window and then the rendering process the jquery will run and open the multiple pages.. i have tried this method in our project oracle apex. it will works fine.. some time it will open 50+ pages..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM