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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:40:31+00:00 2026-05-22T16:40:31+00:00

Google Places API is now generally available. I am trying to use the .ajax()

  • 0

Google Places API is now generally available. I am trying to use the .ajax() call in jQuery to make a call to Google Places. The error I keep getting back is Uncaught SyntaxError: Unexpected token :

I am using jQuery 1.5.2. I tried on 1.5.1 too, but that had the same results. I’d rather not move to 1.6.1 if I can help it.

I’ve made ajax calls like this to other APIs just since, but am having trouble with Google Places. Below is a very basic sample of code you can play with. You’ll need to go get your own key at the API Console Google offers (https://code.google.com/apis/console)

jQuery.noConflict();
 jQuery(document).ready(function(){

  var url = 'https://maps.googleapis.com/maps/api/place/search/json';

  jQuery.ajax({
   url: url,
   dataType: 'jsonp',
   type: 'GET',
   data:  {
     location: '33.787794,-117.853111',
     radius: 1000,
     name: 'coffee',
     key: 'your_key', // add your key here
     sensor: 'false'
     },

   // on success
   success: function(data, textStatus, jqXHR){

      console.log(data);


   },

   // on failure
   error: function (jqXHR, textStatus, errorThrown){
    console.log(jqXHR);
    console.log(textStatus);
    console.log(errorThrown);
   }
   });
 });
  • 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-22T16:40:31+00:00Added an answer on May 22, 2026 at 4:40 pm

    From what I can see from the documentation, the Google Places Web Service API does not support JSONP – only JSON. The error you’re seeing is because the response is simply JSON but is being parsed as if it was JSONP and that causes an error.

    Check out the Google Maps JavaScript API – it includes a Places library that you might be able to use – see google.maps.places.PlacesServices#search().

    AFAIK, there seems to be shift towards removing JSONP support – for example, the Geocoding API used to support JSONP (undocumented) in v2 but no longer in v3. Someone suggested it might be in order to encourage developers to use the JavaScript API instead.

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

Sidebar

Related Questions

I am interacting with the Google Places API and I am trying to get
I'm trying POST a check-in request in Google Places API. The way they described
I'm trying to integrate Google Places API using Apache Camel (2.10-SNAPSHOT) and Spring (3.0.7.RELEASE)
The Google places ( google.maps.places.Autocomplete ) class that is available to use by linking
I am using Google places API for getting places near by the predefined location.
Some people load the google places api with a client parameter, example : <script
I'm using both a Google Places API and a Facebook iOS SDK API in
can any one please tell me how to get the Google places api key
I've been using the Google Maps Places API to do search a map for
I've been working for a few weeks now with the Google Maps API v3,

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.