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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:20:16+00:00 2026-06-03T05:20:16+00:00

Im trying to geocode in my javascript code against Geocoding API. I get url

  • 0

Im trying to geocode in my javascript code against Geocoding API. I get url defined
var url = "http://http://maps.googleapis.com/maps/api/geocode/json?address=New York, Manhattan&sensor=false"

from which I need to retrive a JSON object. First approach I used was according to Wikipedia using XmlHttpRequest like this

var my_JSON_object = {};
var http_request = new XMLHttpRequest();
http_request.open("GET", url, true);
http_request.onreadystatechange = function () {
  var done = 4, ok = 200;
  if (http_request.readyState == done && http_request.status == ok) {
       my_JSON_object = JSON.parse(http_request.responseText);
  }
};

I run the code and get such output in debugger after open() function was triggered:

http_request: XMLHttpRequest
onabort: null
onerror: null
onload: null
onloadend: null
onloadstart: null
onprogress: null
onreadystatechange: function () {
readyState: 1
response: ""
responseText: ""
responseType: ""
responseXML: null
status: [Exception: DOMException]
statusText: [Exception: DOMException]
upload: XMLHttpRequestUpload
withCredentials: false
__proto__: XMLHttpRequest

which means that nothing really useful obviously happened.
My second approach was due to json.org, Ive tried to make a get call with JSONRequest

var requestNumber = JSONRequest.get(
url, 
function (requestNumber, value, exception) {
    if (value) {
        document.write(value);
    } else {
        document.write(exception);
    }
}

Debugger told me that JSONRequest is not defined! Due to json.org its native JS object so whats the problem?
Just to notice, i use properly gained API key from google in the script nearby.

Explanation why my solution failed and any suggestion how to comply with this task would be much appreciated!

  • 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-03T05:20:18+00:00Added an answer on June 3, 2026 at 5:20 am

    I read about hacks like cross domain XHR and Apache/HTTP proxies but the conclusion is that the Javascript API V3 geocoding is your only realistic option. This comment, (from here) while not authoritative, shows that such JSON requests don’t work anymore:

    One would reasonably expect the google maps api to allow cross domain
    access, which it did until recently. Now it doesn’t allow it any more;
    i guess they allege security reasons but I also guess the real reason
    is to oblige you to use only their code to get their service. So the
    only way to get the data via javascript from the client is to use
    Google’s javascript api, which anyway gives you almost the same
    flexibility as calling the api url directly.

    This question had the most useful information.

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

Sidebar

Related Questions

I am trying to parse the JSON at this URL: http://maps.googleapis.com/maps/api/geocode/json?address=canada&sensor=false in Objective-C. I'm
I was trying to download this web page http://maps.googleapis.com/maps/api/geocode/xml?address=Coimbatore+&sensor=true (Google maps api) using bash
I've seen many posts about the Google Geocoding API, described here: http://code.google.com/apis/maps/documentation/geocoding/ but none
I'm using Google's geocding service as documented here ( http://code.google.com/apis/maps/documentation/javascript/services.html#Geocoding ) I'm trying to
I am trying to draw a geodesic polyline with Google Maps JavaScript API from
I am trying to make a geocode request against the local.yahooapis.com geocode interface. This
Im trying out the Google Maps API Geocoding feature.The map loads fine, but im
I am trying to use the Google Maps API to get the latitude and
I am trying to load a StageWebView with the Google Maps Javascript API inside
I'm trying to use the Google maps geocode API to return all parks for

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.