ajax 释放内存,ajax请求后释放内存

ajax请求后,你可以通过这样做释放内存吗?ajax请求后释放内存

function Ajax(){

this.url = null;

this.data = null;

this.success = null;

this.global = true;

this.timeout = JSON_TIMEOUT;

this.cache = false;

this.dataType = 'json';

this.type = 'post';

var _this = this;

this.send = function(){

var jqxhr = $.ajax({

url : this.url,

data : this.data,

timeout : this.timeout,

cache : this.cache,

dataType : this.dataType,

type : this.type,

global : this.global

}

)

.success(this.success)

.error(function(){

Dialog.set_error({

headline : Lang.get('HDL_ERROR'),

body : Lang.get('ERR_TIMEOUT'),

btns : [

{

value : Lang.get('BTN_OK'),

script : function(){},

focus : true

}

]

})

})

.complete(function(){

delete _this;

});

};

}

2011-05-11

clarkk

+1

JavaScript是内存管理的。你为什么想要自己“释放”记忆? –

2011-05-11 09:10:36