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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:00:35+00:00 2026-05-26T16:00:35+00:00

I want to display place details from this json: I have problem with parse

  • 0

I want to display place details from this json:
I have problem with parse it, i want to get “website”, “name” and “rating”.
This is a link to json: https://maps.googleapis.com/maps/api/place/details/json?reference=CpQBjAAAAHDHuimUQATR6gfoWNmZlk5dKUKq_n46BpSzPQCjk1m9glTKkiAHH_Gs4xGttdOSj35WJJDAV90dAPnNnZK2OaxMgogdeHKQhIedh6UduFrW53wtwXigUfpAzsCgIzYNI0UQtCj38cr_DE56RH4Wi9d2bWbbIuRyDX6tx2Fmk2EQzO_lVJ-oq4ZY5uI6I75RnxIQJ6smWUVVIHup9Jvc517DKhoUidfNPyQZZIgGiXS_SwGQ1wg0gtc&sensor=true&key=AIzaSyDSKYz8pCRLHglMPGo1ca6E-geDUQwFNQ8.

{

"html_attributions": [
    "Źródło wpisów: <a href=\"http://www.yellowpages.com.au/\">Yellow Pages</a>"
],
"result": {
    "address_components": [
        {
            "long_name": "10",
            "short_name": "10",
            "types": [
                "street_number"
            ]
        },
        {
            "long_name": "Darling Drive",
            "short_name": "Darling Drive",
            "types": [
                "route"
            ]
        },
        {
            "long_name": "Darling Harbour, Sydney",
            "short_name": "Darling Harbour, Sydney",
            "types": [
                "locality",
                "political"
            ]
        },
        {
            "long_name": "NSW",
            "short_name": "NSW",
            "types": [
                "administrative_area_level_1",
                "political"
            ]
        },
        {
            "long_name": "AU",
            "short_name": "AU",
            "types": [
                "country",
                "political"
            ]
        },
        {
            "long_name": "2000",
            "short_name": "2000",
            "types": [
                "postal_code"
            ]
        }
    ],
    "formatted_address": "Harbourside Centre 10 Darling Drive, Darling Harbour, Sydney NSW, Australia",
    "formatted_phone_number": "(02) 9211 8900",
    "geometry": {
        "location": {
            "lat": -33.871983,
            "lng": 151.199086
        }
    },
    "icon": "http://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
    "id": "677679492a58049a7eae079e0890897eb953d79b",
    "international_phone_number": "+61 2 9211 8900",
    "name": "Zaaffran Restaurant - BBQ and GRILL, Darling Harbour",
    "rating": 3.9,
    "reference": "CpQBjAAAAARBNvpI6EgL3AuRxjwEMz9Va2gFaByrv-0GdqcoZ2QnyfmJiwEX1MLv2uCofWPqxkHPWQNwskrRD58LgD7egsuGooWPDmd2v1Xmt1YTLH0NF0yhXPfSiK62n6m2elI8u6h6FUW6eKJdQVGKLeRfLHl-Ezw_ML1kL4srZ80xuFZNWVmUyHWN2H5BDhhpGI4NwxIQAr5S5g1x1v4WvxS-zq2YBxoU0pVhJe6lLnkKDmm8fgYObLakvL8",
    "types": [
        "restaurant",
        "food",
        "establishment"
    ],
    "url": "http://maps.google.com/maps/place?cid=14075582311174685259",
    "vicinity": "Harbourside Centre 10 Darling Drive, Darling Harbour, Sydney",
    "website": "http://www.zaaffran.com/"
},
"status": "OK"

}

I tried to use this function:

$(document).ready(function() {

   $.getJSON('GOOGLE URL HERE', function(data) {
     $('#dictionary').empty();
      $.each(data, function(entryIndex, entry) {
         var html = '<div class="entry">';
         html += '<h3 class="term">' + entry['name'] + '</h3>';
         html += '<div class="part">' + entry['website'] + '</div>';
         html += '<div class="definition">';
         html += entry['rating'];
         html += '</div>';
         html += '</div>';
         $('#dictionary').append(html);
      });
   });
   return false;

});

It doesn’t work for me.
Help me please, thanks a lot.
Michal

  • 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-26T16:00:35+00:00Added an answer on May 26, 2026 at 4:00 pm

    replace:

     $.each(data, function(entryIndex, entry) {
         var html = '<div class="entry">';
         html += '<h3 class="term">' + entry['name'] + '</h3>';
         html += '<div class="part">' + entry['website'] + '</div>';
         html += '<div class="definition">';
         html += entry['rating'];
         html += '</div>';
         html += '</div>';
         $('#dictionary').append(html);
      });
    

    with:

         var html = '<div class="entry">';
         html += '<h3 class="term">' + data.result['name'] + '</h3>';
         html += '<div class="part">' + data.result['website'] + '</div>';
         html += '<div class="definition">';
         html += entry['rating'];
         html += '</div>';
         html += '</div>';
         $('#dictionary').append(html);
    

    The each is not needed. Access the data directly with data.result.name, since data is a single object as well as result

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to display the TIME field from my mysql table on my website,
Let's say I have this: first \n\n\n second I want to display that on
I have a simple quiz application and I want display a nice timer /
I want to display tabular type data, but it will not be coming from
i want to display some information in a listview using the GridView. i have
I want to display a thumbnail image in a cell of tableViewController , this
I want to display an HTML form containing labelled text fields, like this: First
I have a map where I want to display 2 places: departure and arrival.
I have this website that stores latitude and longitude of some places and I
I have a PDF file stored in server and I want to display it

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.