Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6878377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:42:59+00:00 2026-05-27T04:42:59+00:00

I am using Titanium for a mobile application. In the application, the server returns

  • 0

I am using Titanium for a mobile application. In the application, the server returns JSON data, which is then parsed by JSON.parse(). On Android, it works fine. I also double-checked it to make sure it’s valid with http://jsonformatter.curiousconcept.com/

Here is my JSON data:

    {
   "email":"example@mail.com",
   "count":6,
   "0":{
      "id":"146996",
      "user_id":"25069",
      "item":"item1",
      "start_my_day":"none",
      "scheduled":"n",
      "calendar":"none",
      "start":"00000000T000000",
      "end":"00000000T000000",
      "added":"2011-11-30 06:55:47",
      "updated":"2011-11-30 06:55:47"
   },
   "1":{
      "id":"146988",
      "user_id":"25069",
      "item":"item2",
      "start_my_day":"none",
      "scheduled":"n",
      "calendar":"none",
      "start":"00000000T000000",
      "end":"00000000T000000",
      "added":"2011-11-30 06:52:20",
      "updated":"2011-11-30 06:52:20"
   }
   }

When i tried to check what i get with:

var response = JSON.parse(json, function (key, value) {
    Ti.API.debug('JSON: ' + key + ' <-> ' + value);
    return value;
});

it looks like the object “0” is not parsed as it’s supposed to be, but its fields are made part of it’s parent. Here’s the output:

[DEBUG] JSON: email <-> example@mail.com
[DEBUG] JSON: count <-> 2
[DEBUG] JSON: id <-> 146996
[DEBUG] JSON: user_id <-> 25069
[DEBUG] JSON: item <-> item1
[DEBUG] JSON: start_my_day <-> none
[DEBUG] JSON: scheduled <-> n
[DEBUG] JSON: calendar <-> none
[DEBUG] JSON: start <-> 00000000T000000
[DEBUG] JSON: end <-> 00000000T000000
[DEBUG] JSON: added <-> 2011-11-30 06:55:47
[DEBUG] JSON: updated <-> 2011-11-30 06:55:47
[DEBUG] JSON: 0 <-> [object Object]
[DEBUG] JSON: id <-> 146988
[DEBUG] JSON: user_id <-> 25069
[DEBUG] JSON: item <-> item2
[DEBUG] JSON: start_my_day <-> none
[DEBUG] JSON: scheduled <-> n
[DEBUG] JSON: calendar <-> none
[DEBUG] JSON: start <-> 00000000T000000
[DEBUG] JSON: end <-> 00000000T000000
[DEBUG] JSON: added <-> 2011-11-30 06:52:20
[DEBUG] JSON: updated <-> 2011-11-30 06:52:20
[DEBUG] JSON: 1 <-> [object Object]
[DEBUG] JSON:  <-> [object Object]

From what i see.. it’s not what it’s supposed to return. I tried to enclose the count in quotes, to change the “0” to “10”, but the parsing stays the same.
If you need any more info, please let me know.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:43:00+00:00Added an answer on May 27, 2026 at 4:43 am

    JSON.parse(str, func) is called for each property recursively for formatting/replacement purposes. It is not failing, but you should not use it for your needs.

    If you want to iterate over the object, you’d better parse the JSON regularly and use a loop:

    var parsed = JSON.parse(json);
    
    for(var key in parsed) {
        console.log(key, parsed[key]);
    
        for(var key2 in parsed[key]) {
            console.log("Nested: ", key2, parsed[key][key2]);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an application using titanium mobile. On the simulator, the app works
I want to parse following JSON using Titanium Appcelerator Mobile SDK [{City:null,Distance:469,Email:null,Latitude:0,Longitude:0,Name:Cretin-Derham Hall,PhoneNo:null,SchoolId:75,State:null,Zip:null},{City:null,Distance:213,Email:null,Latitude:0,Longitude:0,Name:East Ridge,PhoneNo:null,SchoolId:76,State:null,Zip:null},{City:null,Distance:26,Email:null,Latitude:0,Longitude:0,Name:Hastings,PhoneNo:null,SchoolId:78,State:null,Zip:null},{City:null,Distance:116,Email:null,Latitude:0,Longitude:0,Name:Stillwater,PhoneNo:null,SchoolId:81,State:null,Zip:null},{City:null,Distance:0,Email:null,Latitude:0,Longitude:0,Name:White
Hi there Im new to mobile application development. I had developed Android apps using
I have been using Titanium for an Android application that does some microblogging through
Hi I am working Android application development using titanium studio.I have developed small application.my
I am creating android/iphone application using Titanium Studio and right now stack with a
I'm creating android app using Titanium mobile. How do I create this interface using
I am using Titanium appcelerator for developing my android application, more over i am
I have recently started creating an iPhone application using Appcelerator's Titanium. Since the application
I am learning how to build mobile JavaScript Application in Titanium Appcelerator. I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.