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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:31:42+00:00 2026-05-16T03:31:42+00:00

I cannot seem to make this simple code work: <script type=text/javascript> $(document).ready(function(){ $.getJSON(‘http://maps.google.com/maps/api/geocode/json?address=cebu&sensor=false&region=ph’, function(results)

  • 0

I cannot seem to make this simple code work:

<script type="text/javascript">
$(document).ready(function(){ 
    $.getJSON('http://maps.google.com/maps/api/geocode/json?address=cebu&sensor=false&region=ph', 
    function(results) {
        alert(results);
    });
});
</script>

It always alerts null even though the results for the json is something like this:

{
  "status": "OK",
  "results": [ {
    "types": [ "locality", "political" ],
    "formatted_address": "Cebu City, Philippines",
    "address_components": [ {
      "long_name": "Cebu City",
      "short_name": "Cebu City",
      "types": [ "locality", "political" ]
    }, {
      "long_name": "Cebu",
      "short_name": "Cebu",
      "types": [ "administrative_area_level_2", "political" ]
    }, {
      "long_name": "Central Visayas",
      "short_name": "Central Visayas",
      "types": [ "administrative_area_level_1", "political" ]
    }, {
      "long_name": "Philippines",
      "short_name": "PH",
      "types": [ "country", "political" ]
    } ],
    "geometry": {
      "location": {
        "lat": 10.3455617,
        "lng": 123.8969328
      },
      "location_type": "APPROXIMATE",
      "viewport": {
        "southwest": {
          "lat": 10.3016523,
          "lng": 123.8329031
        },
        "northeast": {
          "lat": 10.3894650,
          "lng": 123.9609625
        }
      },
      "bounds": {
        "southwest": {
          "lat": 10.2594350,
          "lng": 123.8668156
        },
        "northeast": {
          "lat": 10.3991826,
          "lng": 123.9401150
        }
      }
    }
  } ]
}

What else do I need to do? I have read back-and-forth the jquery manual but I cannot seem to make the simple example work.

Thanks!

  • 1 1 Answer
  • 1 View
  • 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-16T03:31:42+00:00Added an answer on May 16, 2026 at 3:31 am

    http://docs.jquery.com/Getjson
    paragraph 3 :
    “Note that the site you’re trying to call needs to support JSON-P output.”

    Are you sure maps.google.com supports this?

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

Sidebar

Related Questions

i cannot seem to find the answer to this. i uploaded code to pastebin
I cannot seem to find this anywhere.. I apologize if it's very simple. I
I am using drupal 7's premium responsive theme, and I cannot seem to make
I cannot seem to get this date picker working at all. I know it
I cannot seem to get the quotes around this statement right. No matter what
I cannot seem to find the answer to this I am looking for a
I have the following simple script to test the mkdir() function in PHP: <?php
I am trying to make a simple layout like this: --------- - - -
Cannot seem to loop through the XElement and build a datatable. My XElement will
I cannot seem to get user entered data into a table and then printed.

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.