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;
});
};
}
JavaScript是內存管理的。你爲什麼想要自己「釋放」記憶? – Tomalak 2011-05-11 09:10:36