【问题标题】:Confused to read Json混淆阅读Json
【发布时间】:2014-03-18 11:47:14
【问题描述】:

我使用钛应用加速器..我有一个 json 来评估..我打破了我的头来读取 json 值..

[[{"text":"hey"},{"text":"hey"},{"text":"hey"},{"text":"hey"},{"text":"hesssssssssy"},{"text":"hesssssssssy"},{"text":"hess"},{"text":"hessssy"},{"text":"hessssy"},{"text":"hesssssssssy"},{"text":"hesssssssssy"}],"13951406935634631","13951457282115774"]

如何阅读这篇文章..

    var e = JSON.stringify(res);          
    var response = eval("(" + e + ")");       
    Ti.API.info('..' + response[0]);

我在第一个数组中。但是我应该如何获得响应的长度[0]

【问题讨论】:

    标签: json titanium


    【解决方案1】:

    我得到了解决方案..

    我就是这样解决的。。

        for (var i = 0; i < response[0].length; i++) {
            Ti.API.info(response[0][i].text);
        }
        Ti.API.info('length..' + response[0].length);
        Ti.API.info('starttime..' + response[1]);
        Ti.API.info('Endtime..' + response[2]);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-23
      • 1970-01-01
      • 2011-07-12
      • 1970-01-01
      • 2021-12-14
      相关资源
      最近更新 更多