I've been using cURL and ajax to load data from APIs. I also have a local geo.json file. I did
function borders() {
$.ajax({
url: "libs/geojson/countryBorders.geo.json",
type: 'POST',
dataType: 'json',
success: function(result) {
//my code
}
})
}
While this works, my tutor told me to not access the geojson file in the javascript file, but to break it into a PHP and ajax routine. My question is: how would I do this? For APIs, I've saved the API calls to a variable and used curl methods to decode the data, however, I'm not sure what to do with local files.