javascript - How to get around the CORS issue in Google's API? -
i working on application have fetch elevation points using google's elevation api , stuck on infamous cors problem.
var elevationurl = 'https://maps.googleapis.com/maps/api/elevation/json?locations=39.7391536,-104.9847034&key=aizasyagxfguvr4nia7pegx_0hcz0anevckaa58'; $.ajax({ url: elevationurl, type: 'get', // datatype: 'jsonp', success: function(){ } });
for starters tried query fixed point. when this, cors alert in browser's console.
when tried datatype: 'jsonp'
, works , response api browser complains response has error in response doesn't. trying parse json jsonp why getting syntax error in response.
what way around this? how query elevation api via ajax calls?
Comments
Post a Comment