Answer the question
In order to leave comments, you need to log in
Render at load time or on event
What would be more correct in terms of performance: When
loading the page, render the javascript template in the DOM and leave it hidden, or render and show after the event?
Answer the question
In order to leave comments, you need to log in
If a part of the page is shown 100%, then it’s better to immediately render and hide it (the user still waits, an extra couple of milliseconds for him to one place) and if part of the page may not be shown, then it’s better to render it later at the request of the user (lazy type initialization)
If the event is an explicit user action, then it is worth reducing the wait here. The delay in reaction to his action is much more noticeable to the user than the "usual" places of waiting, for example, loading the page as a whole.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question