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 6192361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:55:48+00:00 2026-05-24T02:55:48+00:00

According to my previous post I am trying to get back some information from

  • 0

According to my previous post I am trying to get back some information from a RESTful interface using JSON. I am working on JQuery 1.5.

The problem I face is that I get back as a result undefined values. I am not able to use firebug because my application is developed using PhoneGap and the app is running on the iPhone’s simulator.

If I visit the RESTful interface (I type the “example.json” url in a browser – where example is a valid url created by another developer) returns me results with the following format:

[{"person":{"created_at":"2011-07-18T17:51:33Z","id":1,"name":"John","age":60,"surname":"Smith","car_id":1,"updated_at":"2011-07-18T17:51:33Z"}},{"person":{"created_at":"2011-07-18T17:51:35Z","id":1,"name":"Johnny","age":50,"surname":"Deep","car_id":2,"updated_at":"2011-07-18T17:51:35Z"}}]

I need to get the information id, name, age and store them in an array (not an html table). Just to see if the connection returns any values I use the code:

    var jqxhr = $.getJSON("example.json", function(person) {
        $.each(person, function(i, person) {
            alert(person.name);
            alert(person.age);
        });
    })
    .success(function() { alert("second success"); })
    .error(function() { alert("Cannot connect to the SWT's maps. Please try again later!"); })
    .complete(function() { alert("complete"); });

So, why do I get by the alert undefined as values?

  • 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-24T02:55:49+00:00Added an answer on May 24, 2026 at 2:55 am

    This code should work:

    var jqxhr = $.getJSON("example.json", function(person) {
            $.each(person, function(i, item) {
                alert(item.person.name);
                alert(item.person.age);
            });
        })
        .success(function() { alert("second success"); })
        .error(function() { alert("Cannot connect to the SWT's maps. Please try again later!"); })
        .complete(function() { alert("complete"); });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to pass some POST variables from hidden inputs (using JQuery to change
It is a question build upon the previous question (http://stackoverflow.com/questions/6538448/r-how-to-write-a-loop-to-get-a-matrix). It is different from
According to select name from system_privilege_map System has been granted: SELECT ANY TABLE ...and
i need some clarification on how to populate select(s) with data from mysql. Basically
Please refer my previous post here . I did changes accordingly but getting error.
I am going back though a web-based document numbering system from few weeks ago.
This question follows on from a previous question. However stackoverflow presents me from commenting
I've spent the last three hours trying to get a simple Twitter status update
There is previous post about difference of @synthesize and @dynamic. I wanna to know
According to my previous question with the help of Cosmin Prund, I found how

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.