资料来源:http://jxd-zxf.iteye.com/blog/1440611

 

使用TAB时注意,如果TAB是引用IFRAME,关闭TAB时IFRAME不会被销毁从而导致内存不能释放,大量使用TAB+IFRAME容易导致内存溢出,所以使用TAB时,一定要把jsUtil.js引用到页面上

 1 $.fn.panel.defaults.onBeforeDestroy = function() {/* 回收内存 */
 2     var frame = $('iframe', this);
 3     if (frame.length > 0) {
 4         frame[0].contentWindow.document.write('');
 5         frame[0].contentWindow.close();
 6         frame.remove();
 7         if ($.browser.msie) {
 8             CollectGarbage();
 9         }
10      }
11 };

以上全局扩展方法会覆盖掉panel的onBeforeDestroy事件,自动把iframe销毁释放内存

 

相关文章:

  • 2021-05-22
  • 2021-11-29
  • 2021-08-17
  • 2021-10-21
  • 2022-12-23
  • 2021-08-15
  • 2022-12-23
  • 2021-06-15
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-13
  • 2021-06-05
  • 2022-12-23
相关资源
相似解决方案