I need help with getting a simple string from a Json file on a nonlocal site using JQuery. Here is some useful information.
URL of Json File: https://targetjsonsite.com/fileofinterest.json?api_key=12341234123412341234
Contents of Json File: {"state":"finished"}
Here is my attempt-
<script>
$.getJSON("https://targetjsonsite.com/fileofinterest.json?api_key=12341234123412341234",
{
format: "json"
},
function(data) {
$.each(data.items, function(item){
//right here is where I would want to get the value "state" is set to.
});
});
</script>
I'm having trouble finding an example online that really helps me to understand what's going on. It seems like most explain how jsonp work on a very general level and then give you a very specific example that may not relate. Please help.