Slow page loading in IE

I am developing a website that dynamically creates many table rows. The total number of lines right now is 187. Everything works fine when creating lines, but in IE, when I leave the page, there are a lot of delays. I don’t know how this is related to the heavy DOM manipulation I do on the page? I don’t create any function closures when building dynamic content event handlers, so I don’t think this problem is related to memory leaks. Any insight is greatly appreciated.

+3
source share
4 answers

Do you create element nodes manually or use innerHTML? Although I'm not sure, my suspicion is that IE has its own memory leaks associated with HTML nodes.

I made a demo page that adds 187 rows to a table through jQuery. I believe jQuery.append () uses a smart little trick to turn a string into a collection of nodes. It creates a div and sets the innerHTML of this div to your line, and then clones all the child nodes of this div into the node you specify until the created div is finally deleted.

http://www.andrewpeace.com/stackoverflow/rows/rows.html

I don't get any lag in IE8, but maybe it will lag behind the version you are using. I would love it if you let me know! Perhaps I can help some more.

World

+1
source

YUI (, , javascript) , YUI IE. , , , - ; . IE6, , , , .

apeace : innerHTML DOM. , JQuery .

0

, .

0

porneL. <table> . , ( "" ).

document.createElement(), DOM. , . , node . DOM: http://ejohn.org/blog/dom-documentfragments/

0

Source: https://habr.com/ru/post/1710211/


All Articles