如何手动卸载jQuery库? [英] How can i manually unload the jQuery library?

查看:411
本文介绍了如何手动卸载jQuery库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何手动卸载jQuery库,以便再次释放使用的内存?

How can i manually unload the jQuery library so that the used memory is freed again?

实际的问题是我正在将iquery加载到iframe中,该iframe在更改源之后将jquery保留在内存中,并且不会再次释放它. (有关更多背景信息,请参见使用jquery增加内存使用量)

The actual problem is that I'm loading jquery in an iframe which, after changing the source, keeps jquery in memory and does not free it again. (see increasing memory usage with jquery for more background information)

推荐答案

我认为不可能显式释放jQuery使用的内存,但是您可以尝试的一件事是:

I don't think it's possible to explicitly free up the memory used by jQuery, but one thing you can try would be:

window.jQuery = window.$ = undefined;

(根据Matt的评论):

(per Matt's comment):

更好:

delete window.jQuery;
delete window.$;

这篇关于如何手动卸载jQuery库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆