4 ms·
I wouldn't make dom changes in a tight loop like that. Better would be to accumulate the changes that need to be made and then do a batch change operation inst
by VWWHFSfQ 4y ago
I wouldn't make dom changes in a tight loop like that. Better would be to accumulate the changes that need to be made and then do a batch change operation instead of one at a time like it sounds like you're doing. That code would be slow in any browser.
- jodrellblank 4y agoYou say "it would be slow in any browser" but that's not true. It's fast in Edge and Chrome and slow in FireFox. > "then do a batch change operation" What would the 'batch change' be if not a loop over all the changes, making the changes one by one?
- gramie 4y agoOne possibility would be to create all the matching rows of the table in text (<tr><td>...</td></tr>), and then replace the contents of the table in one assignment. That's pretty fast, although I'm not sure about OP's case.