Jan 30, 2021

Calling Places API using Ajax on browser side giving CORS error

We have generated the Google Places API and by calling the below API we can get the result. 

But, when I call using Ajax on the browser side. It gives me the below error. 

jquery-1.8.0.js:8241 Access to XMLHttpRequest at 'https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Ahmedabad&key=MY-API-KEY&sessiontoken=1234567890' from origin 'http://localhost:5137' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Google Maps JavaScript API error: ApiNotActivatedMapError

We have enabled only Places API, not the Maps JavaScript API. Do we need to enable it? Now, what we need to do to use API on the client-side using ajax? Please advise.
Locked
Informational notification.
This question is locked and replying has been disabled.
Community content may not be verified or up-to-date. Learn more.
Last edited Jan 30, 2021
All Replies
Jan 31, 2021
 
                                                   this forum is only  for gmail problems 
 
 
 

 
heres a list of all forums , please bookmark it for future use  : 
https://productforums.google.com/forum/#!forum/en      if you dont see the one you need scroll down and click the down arrow  to make it show more forums 
 
then press control f to search the page and type  for example calendar 
false
14043559677536936469
true
Search Help Center
true
true
true
true
true
17
Search
Clear search
Close search
Main menu
false
false