0

我可以在 Titanium 移动应用程序中创建使用 8080 以外的端口的 http 客户端吗?

我的代码:

var clietn = Ti.Network.createHTTPClient({
    onload: function(e){
      ....
      ....
    },
    onerror: function(e){
      ....
      ....
    },

    timeout: 3000
});

client.open("GET", Ti.App.Properties.getString('srvName', '192.168.4.248:8888'));

client.send(JSON.stringify({....}));

不能按我的意愿工作;

钛告诉我:

[ERROR][TiJSError(  343)] (main) [27918,533680] ----- Titanium Javascript Runtime  Error ----
[ERROR][TiJSError(  343)] (main) [0,533680] - In app.js:22,1
[ERROR][TiJSError(  343)] (main) [1,533681] - Message: Uncaught ReferenceError: client is not defined
[ERROR][TiJSError(  343)] (main) [0,533681] - Source: client.open("GET",     Ti.App.Properties.getString('servername', '192.168.4.248:88
[ERROR][V8Exception(  343)] Exception occurred at app.js:22: Uncaught ReferenceError: client is not defined
4

0 回答 0