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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:49:15+00:00 2026-06-16T04:49:15+00:00

I have code that gets and parses data in a JSON array. It’s supposed

  • 0

I have code that gets and parses data in a JSON array. It’s supposed to do it for each array entry, but it’s only doing it for the first.

$.ajax({
    url: url,
    dataType: 'json',
    success: function(data){
        $.each(data, function (key, value){
            var mlsnum = value[1];
            var address = value[5] + ' ' + value[6] + ' ' + value[7];
            var city = value[9];
            var state = value[10];
            var zip = value[11];
            var county = value[12];
            var price = value[13];
            var sqft = value[17];
            var yrblt = value[22];
            var bdrms = value[14];
            var baths = value[15];
            $('#test').html(
                '<div class="listing_single">' +
                    '<div class="listing_img"><a href="http://mgoode.com/index.php?option=com_mls&view=mls&mlsnum=' + mlsnum + '"><img class="imgt" src="http://www.universaldynamicmedia.com/sandbox/Images/' + mlsnum + '/HQPhoto-' + mlsnum + '-1.jpeg" /></a></div>' +
                    '<div class="listing_data">' +
                    '<div class="listing_single_address "><a class="address_link" href="http://mgoode.com/index.php?option=com_mls&view=mls&mlsnum=' + mlsnum + '">' + address + '</a></div>' +
                    '<div class="listing_single_city">' + city + ', ' + state + ' ' + zip + '</div>' +
                    '<div class="listing_single_data_spec"><span class="listing_single_price">' + price + '</span>|<span class="data_small">SqFt: ' +  sqft + '</span>|<span class="data_small">Year Built: ' + yrblt + '</span>|<span class="data_small"> Bedrooms: ' + bdrms + '</span>|<span class="data_small"> Baths: ' + baths + '</span></div>' +
                    '</div>' +
                '<div class="clear"></div></div>'
            );   
        });
    },
    error: function(){
        alert('There was an error loading your request.  <br />Please try again later.');
    }
});

The array is structured in 3-Dimensions…

{ "0" : [
    { "0" : [
        { "0" : "data1", "1" : "data2"}]}
    { "1" : [
        { "0" : "data1", "1" : "data2"}]}
]}

I figure it’s only pulling data for .each first dimension item, for which there is only one. I think I need to drill down the .each function into the second dimension, but I don’t know how to do that.

  • 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-06-16T04:49:16+00:00Added an answer on June 16, 2026 at 4:49 am

    You could just nest the jquery each statements? If I understand correctly:

     $.each(data, function(key, value) {
    
            $.each(value[key], function(key2, value2) {
    
                $.each(value2[key2], function(key3, value3){
    
                    // etc.
    
                });
    
            });
    
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If have a piece of code that gets some data from a sql database
I have the following php code that gets a serialized array from a mysql
I have a JsTree that gets populated based on the JSON Data that I
I have some code that gets the current logged in user. userID = request.session.get(_auth_user_id)
I have the following code that gets the MAC address of an interface: static
In PHP I have the following code that gets a file submitted through CGI:
I have a line of code that gets the following error when run through
I have this code that reads from XML file. It gets five strings (groupId,
I have those code snippet that checks the fans table and gets everyone who
I have the following code in a Runnable that gets passed to a thread

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.