Using 1.4.1 against Android under Windows 7. I have a web service being access from the Titanium application, the service returns JSON like this:
{
"VFPData": {
"rows": [
{
"address1": "Orion House",
"address2": "Orion Way",
"address3": "Kettering",
"address4": "Northants",
"comp_name": "Orion Vehicles Leasing",
"contid": 1,
"email": "",
"email2": "",
"fax": "",
"firstname": "David John",
"lastname": "Sear",
"mobile": "",
"phone1": "",
"phone2": "",
"postcode": "NN15 6PE"
},
{
"address1": "Unit 20 Acton Business Park",
"address2": "Acton Lane",
"address3": "London",
"address4": "",
"comp_name": "Orion Vehicles Limited",
"contid": 2,
"email": "[email protected]",
"email2": "",
"fax": "",
"firstname": "Mark",
"lastname": "Johnson",
"mobile": "0888 566 67879",
"phone1": "0208 209 1359",
"phone2": "",
"postcode": "NW10 7NH"
}
]
}
}
However no combination of eval or JSON.parse will return a valid result - for example:
var contacts = JSON.parse(this.responseText);
alert(contacts.length);
That will show an alert dialog with nothing in it. The Titanium HTTPClient calls are working fine as I can
Ti.debug(this.responseText)
with no problem.
That JSON validates OK as well, in jsonlint.com for example.