资料来源:http://jxd-zxf.iteye.com/blog/1440611
使用TAB时注意,如果TAB是引用IFRAME,关闭TAB时IFRAME不会被销毁从而导致内存不能释放,大量使用TAB+IFRAME容易导致内存溢出,所以使用TAB时,一定要把jsUtil.js引用到页面上
$.fn.panel.defaults.onBeforeDestroy = function() {/* 回收内存 */
var frame = $('iframe', this);
if (frame.length > 0) {
frame[0].contentWindow.document.write('');
frame[0].contentWindow.close();
frame.remove();
if ($.browser.msie) {
CollectGarbage();
}
}
};
以上全局扩展方法会覆盖掉panel的onBeforeDestroy事件,自动把iframe销毁释放内存