var JsonClientPatientSearch = Titanium.Network.createHTTPClient();
// API Url to call
var url = GetAPIUrl() + "PatientSearch";
JsonClientPatientSearch.open("POST", url);
//setting Request Header
JsonClientPatientSearch.setRequestHeader("Content-type", "application/json");
JsonClientPatientSearch.send(PatientSearch(PatientSearchCriteria,Credentials,Header));
JsonClientPatientSearch.onload = function(){
};
JsonClientPatientSearch.onerror = function(e){
};
我有很多JSON在我的項目要求,是有可能,我可以寫一個類,並使用它的實例,使JSON呼叫...只是傳遞參數...常見JSON Call類
JavaScript中的「class」是不可能的。但是你可以做一些解決方法來創建可能對你有幫助的「對象」。看看:http://www.phpied.com/3-ways-to-define-a-javascript-class/ – Nobita 2011-06-09 07:50:58