How to get around the CORS issue in Google's API? How to get around the CORS issue in Google's API? json json

How to get around the CORS issue in Google's API?


If you have a backend api for your site you can make simple endpoint to pass through to the google api and execute the google result on the server, where the CORS header doesnt matter.Gives you the benefit of having a better caching system as well.


I use the Allow-Control-Allow-Origin plugin for chrome to get around this kind of thing. It will allow you to enable/disable CORS in chrome.https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi?hl=en


https://medium.com/@akhouri/cors-issues-and-resolutions-803e6abda52aORMake data type to jsonp$('#btnAll').click(function () {  $.ajax({     type: 'Get',     url: 'http://localhost:60545/api/student',     dataType: 'jsonp',  success: function myfunction(data) {     $.each(data, function myfunction(index, val) {        $('#ulStudents').append('<li>' + val.FirstName + '' + val.LastName + '</li>');     });  

}