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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:11:11+00:00 2026-05-15T09:11:11+00:00

I am having trouble parsing the response from my app. Here is the call

  • 0

I am having trouble parsing the response from my app. Here is the call with my best guess at how to deal with the json coming back…

$.ajax({
  url: 'houses.json',
  method: 'GET',
  datatype: 'json',
  success: function (data) {
    $.each(data, function (h) {
      $(h).each(function () {
        console.log(h.address);
      });
    });
});

Here is the response I am getting back from the server:

[{
  "house": {
    "address": "7 view st dunedin nz",
    "lng": 170.500908,
    "id": 3,
    "lat": -45.875059
  }
}, {
  "house": {
    "address": "26 brown st dunedin nz",
    "lng": 170.496236,
    "lat": -45.875834,
  }
}]

the best I can get is having it say undefined. Once. I am trying to set up a loop for creating markers for a google map.
I could use another pair of eyes.
Anyone?
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-15T09:11:12+00:00Added an answer on May 15, 2026 at 9:11 am

    Since h is an array, you need to go down the property chain, h is a collection of house objects which have an address property, so change it a bit, like this:

       $.each(data, function(i, h){
         console.log(h.house.address);
       });
    

    Make sure to remove that extra loop around it, no need since there’s only one array.

    Here’s a visual way to think of it:

       h       h.house           h.house.address
     [ {       "house":{         "address":"7 view st dunedin nz".....
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble parsing a json response. Its created via php and sent back
I am having trouble parsing my JSON which i get from javascript. The format
I'm having some trouble parsing a JSON that I obtain from my DB to
I'm relatively new to jquery/ajax, and I'm having trouble parsing the results from a
I'm having trouble parsing an iso date from my json api/mongodb using rest kit.
I am having trouble with PHP parsing of a SoapClient call's response. For some
I am having a little trouble with parsing XML from a google checkout response.
i'm still transitioning from as2 to as3, i'm having trouble with parsing XML data
I'm having trouble parsing Json string to Objects in C#. I'm using this: JavaScriptSerilizer
Im having a little issue with parsing json date. Here is what I would

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.