I read that javascript gets significant performance benefits from off-dom modifications. Earlier today I read the clone documentation:
"Please note that when using the .clone () method, we can modify the cloned elements or their contents to (re) inserting them into the document."
Is the implication that if I have 1000 LI and I want to make changes in all of them, the most effective method would be to clone, modify the clone, destroy the original and place the clone?
How could you make this modification the most efficient way?
detach() - , , :
http://api.jquery.com/detach/
: , /, , . , .:)
: , , .detach(), - addClass, detach.
"", .
, : http://jsbin.com/uwode3/5 vs http://jsbin.com/uwode3/4
, , , DOM, , . , clone-modify-replace , , , , ... , , , .
... ... "" DOM : removeChild() (, jQuery, detach()) - , , , .
removeChild()
detach()
... , , , UL, 1K LI, ...
: .detach() , , ., DOM , ( ) , , firefox ( , ). , , , .
.detach()
Source: https://habr.com/ru/post/1751809/More articles:Saving a heterogeneous array in C # - listIs there a way to simulate scrollViewDidScrollToBottom in a UIScrollView? - objective-cHibernate - CDI - javaConfusion with Gravatar URLs - formatGrails and multi-threaded process - javaGoogle Maps not working in Django template on App Engine development server - google-app-engineDouble message form - htmlHow to determine if an iOS device has a cellular radio station? - iosWhen studying Haskell, take care to help with coding style? - coding-styleBest Practice for Password Reset in ASP.NET MVC - asp.net-mvcAll Articles