var JsonClient = Titanium.Network.createHTTPClient();
// API Url to call
var url = "";
JsonClient.open("POST", url, true);
JsonClient.onload = function () {
// after processing the response
json = null;
}
JsonClient.onerror = function (e) {
actAllergyInd.hide();
Ti.UI.createAlertDialog({
title: 'Error',
message: JsonClient.statusText,
buttonNames: ['Ok']
}).show();
};
}
//setting Request Header
JsonClient.setRequestHeader("Content-type", "application/json");
JsonClient.send(data);
JsonClient = null;
我想将我的JsonClient对象设置为null
以及我得到null的Json response
。 我是以正确的方式做的吗?
答案 0 :(得分:1)
您可以使用delete
运算符:
https://developer.mozilla.org/en/JavaScript/Reference/Operators/delete
delete JsonClient;