0

我想将数据上传到服务器。它通过了,这将返回,我该怎么办?请帮我

代码只是示例

but4.addEventListener('click',function(){

var xhr = Titanium.Network.createHTTPClient({
timeout : '15000',
});

xhr.onload = function (){
Titanium.API.info('onload');
Ti.API.info('Sucess'+ this.status + '  '+ this.readyState);
};

xhr.onerror = function(){
Ti.API.info('error');
res.hide();
};

xhr.ondatastream=function(){
Ti.API.info('ondatastream');
};
var abc1 = 'iPhone_request=<category><name>game_abc</name></category>';

xhr.open('POST','http://www.imobdevtech.com/assignments/uploadcategory.php');
xhr.send(abc1);
});

提前致谢,

4

1 回答 1

1

试试这个,我觉得这对你很有帮助,

xhr.send({iPhone_request='<category><name>Game Name</name></category>'});
于 2012-02-29T09:39:33.047 回答