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

  • SEARCH
  • Home
  • 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 6936797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:16:49+00:00 2026-05-27T12:16:49+00:00

I am building Dojo mobile app. I have a Json file like: { Introduction:

  • 0

I am building Dojo mobile app. I have a Json file like:

{
    Introduction: 
    [
        {
            title:   "Introduction",
            toolbar: "Page 1",
            content: "cont, aabitant morbi tristique..."
        },
        {
            title:   "Introduction",
            toolbar: "Page 2",
            content: "contesent vel nisi ipsum..."
        }
    ],
    Services: 
    [
        {
            title:   "services",
            toolbar: "Page 1",
            content: "Cras adipiscing sapien nec..."
        }
    ]
}

Following code prints introduction as written in title

dojo.xhrPost({
        url: "diet.json",
        handleAs: "json",
        load: function(response) {
            console.log(response.Introduction[0].title);
        }
    });

I am able to get inner data. How can I get first headings i.e.

  • Introduction
  • Services
  • 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-27T12:16:50+00:00Added an answer on May 27, 2026 at 12:16 pm

    So you want the first title in each object in your response?

    for (key in response)
        console.log(key + ": " + response[key][0].title);
    

    Of course this assumes there’s at least one element in each array in the response. If some may be empty, you’d want something like this:

    for (key in response)
        console.log(key + ": " + 
                     (response[key].length > 0 ? response[key][0].title : "empty"));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building Dojo mobile app. I have a Json file like: { Introduction:
Building an offline web app in VS2010. I have a master page with a
I'm building a Dojo DataGrid from JSON data provided by my REST interface. The
Building a new Mobile Web Platform for Mobile Users to purchase & download content
Building an MVC 3 app with Razor and I have some information persisted in
Building an app with the Facebook JavaScript API that will embedded into a page
Building a web app here and I would like to be able to alternate
Building a lottery scratch-card app in Java. Have allot of it done, just need
Building a Django app on a VPS. I am not very experienced with setting
Building my first SL MVVM application (Silverlight4 RC) and have some issues i don't

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.