Javascript tianium-Json对象返回空数组

Javascript tianium-Json对象返回空数组,javascript,json,titanium,Javascript,Json,Titanium,我的WEC webservice返回一个JSON对象,我想在我的Tianium应用程序中使用它,但问题是,JSON对象中有数组,我可以在控制台中看到它们,但当我试图通过提供索引进行访问时,它不起作用 示例 { "GetDoctorFavoriteTestResult": "{\"CountryList\":null,\"AddressDetails\":null,\"CollectionAddressDetails\":null,\"CourierAddressDetails\":nul

我的WEC webservice返回一个JSON对象,我想在我的Tianium应用程序中使用它,但问题是,JSON对象中有数组,我可以在控制台中看到它们,但当我试图通过提供索引进行访问时,它不起作用

示例

{
    "GetDoctorFavoriteTestResult": "{\"CountryList\":null,\"AddressDetails\":null,\"CollectionAddressDetails\":null,\"CourierAddressDetails\":null,\"labAddressDetails\":null,\"TestDetails\":[{\"TestID\":29,\"TestName\":\"CEA-Carcino Embryonic Antigen, serum\",\"Row\":0,\"LabID\":0,\"DoctorPatientMappingId\":0,\"PatientId\":0,\"TestDesc\":\"Colonic cancer marker.\\n\\nNote\\n1. This test is not recommended for cancer screening in the general population.\\n2. False negative / positive results are observed in patients receiving mouse monoclonal antibodies for diagnosis or therapy.\\n3. Patients with confirmed carcinoma may show normal pre-treatment CEA levels. Hence this assay, regardless of level, should not be interpreted as absolute evidence for presence or absence of malignant disease. The assay value should be used in conjunction with fi\",\"TestPrice\":0.0,\"BasePrice\":0.0,\"DiscountPrice\":0.0,\"Currency\":null,\"SampleAtHome\":false,\"IsActive\":false,\"LabName\":null,\"TestPerformedLabName\":null,\"Link\":null,\"TestResult\":null,\"UploadedTestFile\":null,\"PatientName\":null,\"TestRemarks\":null,\"ResultType\":null,\"TestFavouriteId\":0,\"CollectionPrice\":0.0,\"TotalPrice\":0.0,\"PaymentToECL\":0.0,\"PaymentFromECL\":0.0,\"ToBeListed\":true,\"OrderAmt\":0.0,\"AfterDiscountPrice\":0.0,\"CollectionType\":0,\"PreferedDate\":\"0001-01-01T00:00:00\",\"PreferedTime\":null,\"SpecialInstructions\":null,\"PaymentType\":0,\"PaymentTypeStatus\":null,\"PaymentStatus\":null,\"CourierAddressId\":0,\"CollectionAddressId\":0,\"OrderId\":0,\"OrderDetailId\":0,\"BookedDateTime\":\"0001-01-01T00:00:00\",\"ModifiedDate\":\"0001-01-01T00:00:00\",\"PreviousSlotDateTime\":null,\"CategoryID\":0,\"TestCode\":null,\"CPTCode\":null,\"Abbrevation\":\"CEA\",\"MethodID\":0,\"SampleTypeID\":0,\"SampleTypeDesc\":null,\"TempId\":0,\"Description\":null,\"TAT\":null,\"TestType\":0,\"SampleOptions\":null,\"IdCountry\":0,\"IdState\":0,\"IdCity\":0,\"MethodName\":null,\"CategoryName\":null,\"TestCondition\":null,\"HyperLink\":null,\"ReferenceValue\":null,\"Units\":null,\"ReportAttributes\":null,\"OrderStatus\":null,\"TestAvailableHome\":false,\"PathologistId\":0,\"PathologistName\":null,\"TechnicianName\":null,\"PathologistSign\":null,\"TechnicianSing\":null,\"EmailId\":null,\"LabEmailId\":null,\"SampleCollectedDate\":null,\"ReportUploadedDate\":null,\"IsExists\":false},{\"TestID\":73,\"TestName\":\"Family Finder + Y-DNA67\",\"Row\":0,\"LabID\":0,\"DoctorPatientMappingId\":0,\"PatientId\":0,\"TestDesc\":\"Family Finder + Y-DNA67\",\"TestPrice\":0.0,\"BasePrice\":0.0,\"DiscountPrice\":0.0,\"Currency\":null,\"SampleAtHome\":false,\"IsActive\":false,\"LabName\":null,\"TestPerformedLabName\":null,\"Link\":null,\"TestResult\":null,\"UploadedTestFile\":null,\"PatientName\":null,\"TestRemarks\":null,\"ResultType\":null,\"TestFavouriteId\":0,\"CollectionPrice\":0.0,\"TotalPrice\":0.0,\"PaymentToECL\":0.0,\"PaymentFromECL\":0.0,\"ToBeListed\":true,\"OrderAmt\":0.0,\"AfterDiscountPrice\":0.0,\"CollectionType\":0,\"PreferedDate\":\"0001-01-01T00:00:00\",\"PreferedTime\":null,\"SpecialInstructions\":null,\"PaymentType\":0,\"PaymentTypeStatus\":null,\"PaymentStatus\":null,\"CourierAddressId\":0,\"CollectionAddressId\":0,\"OrderId\":0,\"OrderDetailId\":0,\"BookedDateTime\":\"0001-01-01T00:00:00\",\"ModifiedDate\":\"0001-01-01T00:00:00\",\"PreviousSlotDateTime\":null,\"CategoryID\":0,\"TestCode\":null,\"CPTCode\":null,\"Abbrevation\":\"Family Finder + Y-DNA67\",\"MethodID\":0,\"SampleTypeID\":0,\"SampleTypeDesc\":null,\"TempId\":0,\"Description\":null,\"TAT\":null,\"TestType\":0,\"SampleOptions\":null,\"IdCountry\":0,\"IdState\":0,\"IdCity\":0,\"MethodName\":null,\"CategoryName\":null,\"TestCondition\":null,\"HyperLink\":null,\"ReferenceValue\":null,\"Units\":null,\"ReportAttributes\":null,\"OrderStatus\":null,\"TestAvailableHome\":false,\"PathologistId\":0,\"PathologistName\":null,\"TechnicianName\":null,\"PathologistSign\":null,\"TechnicianSing\":null,\"EmailId\":null,\"LabEmailId\":null,\"SampleCollectedDate\":null,\"ReportUploadedDate\":null,\"IsExists\":false},{\"TestID\":69,\"TestName\":\"Family Finder (For Both)\",\"Row\":0,\"LabID\":0,\"DoctorPatientMappingId\":0,\"PatientId\":0,\"TestDesc\":\"Family Finder (For Both)\",\"TestPrice\":0.0,\"BasePrice\":0.0,\"DiscountPrice\":0.0,\"Currency\":null,\"SampleAtHome\":false,\"IsActive\":false,\"LabName\":null,\"TestPerformedLabName\":null,\"Link\":null,\"TestResult\":null,\"UploadedTestFile\":null,\"PatientName\":null,\"TestRemarks\":null,\"ResultType\":null,\"TestFavouriteId\":0,\"CollectionPrice\":0.0,\"TotalPrice\":0.0,\"PaymentToECL\":0.0,\"PaymentFromECL\":0.0,\"ToBeListed\":true,\"OrderAmt\":0.0,\"AfterDiscountPrice\":0.0,\"CollectionType\":0,\"PreferedDate\":\"0001-01-01T00:00:00\",\"PreferedTime\":null,\"SpecialInstructions\":null,\"PaymentType\":0,\"PaymentTypeStatus\":null,\"PaymentStatus\":null,\"CourierAddressId\":0,\"CollectionAddressId\":0,\"OrderId\":0,\"OrderDetailId\":0,\"BookedDateTime\":\"0001-01-01T00:00:00\",\"ModifiedDate\":\"0001-01-01T00:00:00\",\"PreviousSlotDateTime\":null,\"CategoryID\":0,\"TestCode\":null,\"CPTCode\":null,\"Abbrevation\":\"Family Finder (For Both)\",\"MethodID\":0,\"SampleTypeID\":0,\"SampleTypeDesc\":null,\"TempId\":0,\"Description\":null,\"TAT\":null,\"TestType\":0,\"SampleOptions\":null,\"IdCountry\":0,\"IdState\":0,\"IdCity\":0,\"MethodName\":null,\"CategoryName\":null,\"TestCondition\":null,\"HyperLink\":null,\"ReferenceValue\":null,\"Units\":null,\"ReportAttributes\":null,\"OrderStatus\":null,\"TestAvailableHome\":false,\"PathologistId\":0,\"PathologistName\":null,\"TechnicianName\":null,\"PathologistSign\":null,\"TechnicianSing\":null,\"EmailId\":null,\"LabEmailId\":null,\"SampleCollectedDate\":null,\"ReportUploadedDate\":null,\"IsExists\":false}],\"ExistingMappedTest\":null,\"AllTestDetails\":null,\"CountryPrices\":null,\"PriceComponents\":null,\"OrderedTestDetails\":null,\"BookedSlots\":null,\"LabScheduleDetails\":null,\"ReturnValue\":0,\"ReturnMessage\":null,\"TotalRecords\":0,\"Rows\":0,\"IsActive\":false}"
}
在这里,我可以通过使用JSON.parse访问GetDoctorFavoriteTestResult.CountryList,但是当我试图获取数组GetDoctorFavoriteTestResult.TestDetails时,它显示为空

即使在浏览器中,Webservice也能完美运行

同样,我可以在钛合金控制台窗口中看到阵列数据


有解决方案吗?

安装此chrome扩展。它会自动为您提供钛应用程序的路径


谢谢

这样更容易看到您是如何解析json的

试试这个:
GetDoctorFavoriteTestResult[0]。TestDetails

您是否在PC或mac?PC上安装了chrome,目前正在为android工作。chrome?我说的是钛合金,是的,我在chrome和firefox中测试了这项服务,但数据是一样的。我有chrome,现在该怎么办?你能展示一下GetDoctorFavoriteTestResult的代码吗?TestDetails{hey:“guy”,anumber:243,anarray:{whoa:“nuts”,anarray:[],more:“stuff”},awesome:真,假的,意思是:null,link:“,notLink:“很好”}我是通过usign得到的ChromeEyes的扩展是您的json数据现在没有格式化,并为您提供了路径?从哪里可以获得路径?扩展中没有任何路径抱歉打扰您:D我的此扩展无法正常工作,让我先修复此扩展无法工作,我已在两台机器上尝试,扩展未显示。它看起来像这样,但未定义:(我正在查看你刚刚发布的这个链接,我看到确实没有提到TestDetails。我很抱歉,我只是更新了服务,让这个坏女孩运行