Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/silverlight/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Titanium 如何将数据上传到服务器?通过<;参数>;这将返回<;id>;?_Titanium_Titanium Mobile_Titanium Modules - Fatal编程技术网

Titanium 如何将数据上传到服务器?通过<;参数>;这将返回<;id>;?

Titanium 如何将数据上传到服务器?通过<;参数>;这将返回<;id>;?,titanium,titanium-mobile,titanium-modules,Titanium,Titanium Mobile,Titanium Modules,我想把数据上传到服务器上。它过去了,这会回来,我怎么办? 请帮帮我 代码只是一个例子 but4.addEventListener('click',function(){ var xhr = Titanium.Network.createHTTPClient({ timeout : '15000', }); xhr.onload = function (){ Titanium.API.info('onload'); Ti.API.info('Sucess'+ this.status + '

我想把数据上传到服务器上。它过去了,这会回来,我怎么办? 请帮帮我

代码只是一个例子

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);
});
but4.addEventListener('click',function(){
var xhr=Titanium.Network.createHTTPClient({
超时:“15000”,
});
xhr.onload=函数(){
钛.API.信息(“装载”);
Ti.API.info('success'+this.status+''+this.readyState);
};
xhr.onerror=函数(){
Ti.API.info(“错误”);
res.hide();
};
xhr.ondatastream=函数(){
Ti.API.info(“ondatastream”);
};
var abc1='iPhone_request=game_abc';
xhr.open('POST','http://www.imobdevtech.com/assignments/uploadcategory.php');
xhr.send(abc1);
});

提前谢谢,

试试这个,我想这对你很有帮助

xhr.send({iPhone_request='<category><name>Game Name</name></category>'});
xhr.send({iPhone\u request='Game Name'});