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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:26:21+00:00 2026-05-23T20:26:21+00:00

I am trying to send get requests to the Google Places API with this

  • 0

I am trying to send get requests to the Google Places API with this code:

<script type="text/javascript" src="json2.js">
var googleQuery;
function load() {
    googleQuery = JSONRequest.get(  
       "https://maps.googleapis.com/maps/api/place/details/json?reference=3af0d044d45cd8587d9a3522bc98a95d4f60c6a8&sensor=true&key=xxxxxxxxxxxxxxxx",
       function (googleQuery, value, exception) {
          if (value) {
             processResponse(value);
          }
          else {
             processError(exception);
          }
       }
    ); 
}
</script>

And calling the load function in the body onload.

  <body onload="load()">
  </body>

I am including the src=”json2.js” in this <script> instead of in its own <script>, since I was getting a “JSONRequest is undefined” error…but I am still getting a strange “load is undefined” error.

Am I going about this JSON request correctly?

  • 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-23T20:26:22+00:00Added an answer on May 23, 2026 at 8:26 pm

    Try:

    <script type="text/javascript" src="json2.js"></script>
    <script type="text/javascript">
        var googleQuery;
        function load(){
        googleQuery = JSONRequest.get(  
            "https://maps.googleapis.com/maps/api/place/details/json?reference=3af0d044d45cd8587d9a3522bc98a95d4f60c6a8&sensor=true&key=xxxxxxxxxxxxxxxx",
         function (googleQuery, value, exception) {
            if (value) {
                processResponse(value);
            } else {
                processError(exception);
            }
          }
        ); 
       }
    </script>
    

    You can’t have JavaScript code inside a script tag which has the src attribute. You should place the inline code on another script tag, otherwise it won’t be executed.

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

Sidebar

Related Questions

I'm trying to send a HTTP POST request to a Google server and get
I'm trying out jQuery to send POST and GET requests to Django. So far
im trying to send rest api Users.getLoggedInUser i have all the secret session and
I'm trying to integrate a Flex app with Google Checkout and code that runs
I'm trying to send json string in the get request to the server, here
I've created a RESTful API that supports GET/POST/PUT/DELETE requests. Now I want my API
I'm trying to send an http get request via the httplib, but I'm facing
I am trying to send email using PHP mail. I get the following error:
I am trying to get tweets from Twitter and send it through GTalk using
I've been trying to google this but have been unable to find a solution

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.