Recently I've been doing a lot of modal window pop-ups and what not, for which I used jQuery.
(最近,我一直在做很多模态窗口弹出窗口,而我没有使用jQuery。)
The method that I used to create the new elements on the page has overwhelmingly been along the lines of:(我用来在页面上创建新元素的方法绝大多数遵循以下原则:)
$("<div></div>");
However, I'm getting the feeling that this isn't the best or the most efficient method of doing this.
(但是,我感到这不是执行此操作的最佳或最有效的方法。)
What is the best way to create elements in jQuery from a performance perspective?(从性能的角度来看,在jQuery中创建元素的最佳方法是什么?)
This answer has the benchmarks to the suggestions below.
(该答案具有以下建议的基准。)
ask by Darko Z translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…