jQuery clean和cleanData方法的目的是什么? [英] What is the purpose of jQuery clean and cleanData methods?

查看:95
本文介绍了jQuery clean和cleanData方法的目的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

jQuery 具有 clean cleanData 方法. jQuery clean cleanData 方法的目的是什么?

jQuery has clean and cleanData methods. What is the purpose of jQuery clean and cleanData methods?

推荐答案

两者都是内部未公开文档的方法,因此您不应使用它们,也不应该依赖于它们的当前行为,因为它们将来可能会更改或消失.

Both are internal, undocumented methods, so you should not use them or rely on their current behavior, because they might change or disappear in the future.

也就是说,clean()清除了从传递给某些函数(最值得注意的是传递给

That said, clean() sanitizes the markup in the document fragments that are created from the HTML strings passed to some functions (most notably to $() itself).

cleanData()当元素从DOM中消失时,释放与元素关联的数据.通过 remove()空(),或 html().

cleanData() frees the data associated with elements when they disappear from the DOM, e.g. through remove(), empty(), or html().

这篇关于jQuery clean和cleanData方法的目的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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