0

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.

3
  • Does this answer your question? Jquery automatically change select box value when another select box change Commented Jun 20, 2022 at 14:41
  • hi WebPajooh! Sorry, I was going to ask a related to the select box but I realised where I was going wrong while I was typing it out. I think that StackOverflow saved it as a draft and I didn't realise that I didn't change the title of the question when asking this new questionn Commented Jun 20, 2022 at 14:46
  • I found this post which answered my question stackoverflow.com/questions/68023021/… Commented Jun 20, 2022 at 15:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.