Is it possible to use iframes in IE without memory leaks?

后端 未结 4 970
野的像风
野的像风 2020-12-05 03:13

All versions of IE (including 10) appear to hold on to a significant amount of memory allocated by iframes until window.top.unload occurs. This creates quite the challenge f

4条回答
  •  北荒
    北荒 (楼主)
    2020-12-05 03:26

    In IE 11, just setting iframe.src = 'about:blank' seems to fix this. Otherwise, you can watch the memory grow forever in the F12 Memory tab, even if you're removing iframes from the DOM and letting them be garbage collected. If you blank the iframes first, you see the memory go up and down as you'd expect.

提交回复
热议问题