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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:34:37+00:00 2026-05-20T01:34:37+00:00

I was trying to use $.getJSON to go through the json arrays from the

  • 0

I was trying to use $.getJSON to go through the json arrays from the twitter api sample code and display each of these values using jquery ? but it wasnt displaying anything any example/help would be appreciated

I want to display each tweet users long & lat in google maps..

thanks in advance

This json array is from http://dev.twitter.com/doc/get/geo/search

{
  "result": {
    "places": [
      {
        "name": "Twitter HQ",
        "country": "The United States of America",
        "country_code": "US",
        "attributes": {
          "street_address": "795 Folsom St"
        },
        "url": "http://api.twitter.com/1/geo/id/247f43d441defc03.json",
        "id": "247f43d441defc03",
        "bounding_box": {
          "coordinates": [
            [
              [
                -122.400612831116,
                37.7821120598956
              ],
              [
                -122.400612831116,
                37.7821120598956
              ],
              [
                -122.400612831116,
                37.7821120598956
              ],
              [
                -122.400612831116,
                37.7821120598956
              ]
            ]
          ],
          "type": "Polygon"
        },
        "contained_within": [
          {
            "name": "San Francisco",
            "country": "The United States of America",
            "country_code": "US",
            "attributes": {

            },
            "url": "http://api.twitter.com/1/geo/id/5a110d312052166f.json",
            "id": "5a110d312052166f",
            "bounding_box": {
              "coordinates": [
                [
                  [
                    -122.51368188,
                    37.70813196
                  ],
                  [
                    -122.35845384,
                    37.70813196
                  ],
                  [
                    -122.35845384,
                    37.83245301
                  ],
                  [
                    -122.51368188,
                    37.83245301
                  ]
                ]
              ],
              "type": "Polygon"
            },
            "full_name": "San Francisco, CA",
            "place_type": "city"
          }
        ],
        "full_name": "Twitter HQ, San Francisco",
        "place_type": "poi"
      }
    ]
  },
  "query": {
    "url": "http://api.twitter.com/1/geo/search.json?query=Twitter+HQ&accuracy=0&autocomplete=false&granularity=neighborhood",
    "type": "search",
    "params": {
      "granularity": "neighborhood",
      "accuracy": 0,
      "autocomplete": false,
      "query": "Twitter HQ"
    }
  }
}



<!---- CODE --->
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>jQuery-TwitterAPI json</title>
<script type="text/javascript"         src="jquery.js">
</script>
<script type="text/javascript">
$(document).ready(function() {
  $('#letter-b a').click(function() {
    $.getJSON('geo.json', function(data) {
      $('#tweetstuff').empty();
      $.each(data.results, function(entryIndex, entry) {
        var html = '<div class="entry">';
        html += 'places' + entry.places + '</br>';
        html += 'name' + entry.places.name + '</br>';
        html += 'country' + entry.places.country + '</br>';
        html += 'attributes' + entry.places.attributes + '</br>';
        html += 'url' + entry.places.url + '</br>';
        html += 'id' + entry.places.id + '</br>';
        html += 'places' + entry.places.bounding_box + '</br>';
        html += 'coordinates' + entry.places.coordinates + '</br>';
        html += '</div>';
        $('#dictionary').append(html);
      });
    });
    return false;
  });
});



</script>
</head>
<body>

<h1>jQuery-Twitter API Example</h1>

json

      <div class="letters">
        <div class="letter" id="letter-a">
          <h3><a href="#">A</a></h3>
        </div>

      </div>
      <div id="tweetstuff">
      </div>

</body>
</html>
  • 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-20T01:34:38+00:00Added an answer on May 20, 2026 at 1:34 am

    There are a bunch of errors in your code. It is “result”, not “results” and it is an object, not array, so you are out to use data.result.places – this is where good JavaScript editor helps. Also, there is no element with id “dictionary” on your page. And it is <br/>, not </br>.

    Here is the working code:

    <!DOCTYPE html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>jQuery-TwitterAPI json</title>
    <script type="text/javascript" src="jquery.js">
    </script>
    <script type="text/javascript">
    var data = {
      "result": {
        "places": [
          {
            "name": "Twitter HQ",
            "country": "The United States of America",
            "country_code": "US",
            "attributes": {
              "street_address": "795 Folsom St"
            },
            "url": "http://api.twitter.com/1/geo/id/247f43d441defc03.json",
            "id": "247f43d441defc03",
            "bounding_box": {
              "coordinates": [
                [
                  [
                    -122.400612831116,
                    37.7821120598956
                  ],
                  [
                    -122.400612831116,
                    37.7821120598956
                  ],
                  [
                    -122.400612831116,
                    37.7821120598956
                  ],
                  [
                    -122.400612831116,
                    37.7821120598956
                  ]
                ]
              ],
              "type": "Polygon"
            },
            "contained_within": [
              {
                "name": "San Francisco",
                "country": "The United States of America",
                "country_code": "US",
                "attributes": {
    
                },
                "url": "http://api.twitter.com/1/geo/id/5a110d312052166f.json",
                "id": "5a110d312052166f",
                "bounding_box": {
                  "coordinates": [
                    [
                      [
                        -122.51368188,
                        37.70813196
                      ],
                      [
                        -122.35845384,
                        37.70813196
                      ],
                      [
                        -122.35845384,
                        37.83245301
                      ],
                      [
                        -122.51368188,
                        37.83245301
                      ]
                    ]
                  ],
                  "type": "Polygon"
                },
                "full_name": "San Francisco, CA",
                "place_type": "city"
              }
            ],
            "full_name": "Twitter HQ, San Francisco",
            "place_type": "poi"
          }
        ]
      },
      "query": {
        "url": "http://api.twitter.com/1/geo/search.json?query=Twitter+HQ&accuracy=0&autocomplete=false&granularity=neighborhood",
        "type": "search",
        "params": {
          "granularity": "neighborhood",
          "accuracy": 0,
          "autocomplete": false,
          "query": "Twitter HQ"
        }
      }
    };
    
    
    $(document).ready(function() {
      $('#letterA A').click(function() {
        //$.getJSON('geo.json', function() {
          //$('#tweetstuff').empty();
          $.each(data.result.places, function(entryIndex, entry) {
            var html = '<div class="entry">';
            html += 'place ' + entryIndex + '<br/>';
            html += 'name: ' + entry.name + '<br/>';
            html += 'country: ' + entry.country + '<br/>';
            html += 'attributes: ' + entry.attributes + '<br/>';
            html += 'url: ' + entry.url + '<br/>';
            html += 'id: ' + entry.id + '<br/>';
            html += 'places: ' + entry.bounding_box.coordinates + '<br/>';
            //html += 'coordinates' + entry.coordinates + '<br/>';
            html += '</div>';
            $('#dictionary').append($(html));
          });
        //});
        return false;
      });
    });
    
    
    
    </script>
    </head>
    <body>
    
    <h1>jQuery-Twitter API Example</h1>
    
    json
    
          <div class="letters">
            <div class="letter" id="letterA">
              <h3><a href="#">A</a></h3>
            </div>
    
          </div>
          <div id="dictionary">
          </div>
    
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use the jQuery Datepicker to display specific info from JSON
I'm trying to get json code from page.I use this private function __ajax_admin_search($username =
I'm trying to call this api http://www.wikirandom.org/json Using this code - $.getJSON('http://www.wikirandom.org/json', function(data) {
I'm trying to use jQuery to call some custom API via Ajax/$.getJSON . I'm
I'm trying to use $.getJSON inside $.post function and display returned value in textbox
I'm trying to use jQuery.getJSON to get data from a domain I don't own
I am trying to use a jquery getJSON get information for my table from
I'm trying to use JQuery's $.getJSON to access Model data from the Controller, and
I'm trying to use JSON for the first and I use the code: var
I am trying to use the Google Elevation API with the getJSON function of

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.