我想知道以下伪jQuery代码中是否会发生内存泄漏(因为成功回调总是引用_this)?
var _this = this;
$.ajax({
url: "foo",
type: "POST",
data: data,
success: function() {
// Do stuff with _this
_this.doStuffs();
})
我想知道以下伪jQuery代码中是否会发生内存泄漏(因为成功回调总是引用_this)?
var _this = this;
$.ajax({
url: "foo",
type: "POST",
data: data,
success: function() {
// Do stuff with _this
_this.doStuffs();
})