First of all, you did not specify a closing quotation mark in your URL.
Secondly, the website does not allow javascript to be placed in people's browsers and to make requests to it. This is a collaborative design with browsers and websites. You can see this error if you open the console while executing the request.
XMLHttpRequest cannot load http://www.airport-data.com/api/ac_thumb.json?m=C822AF . The requested resource does not have an Access-Control-Allow-Origin header. The origin of http://www.example.com 'is therefore not permitted.
Thirdly, the response variable has more data than what you received. If you try this code:
$.get('http://www.airport-data.com/api/ac_thumb.json?m='+value.hex, function (response) { console.log(response); });
Then open the Javascript console in your browser, you will see the object in the log with the attached information. If you add "json" as the third parameter, instead make a response in the data you need:
$.get('http://www.airport-data.com/api/ac_thumb.json?m='+value.hex, function (response) { console.log(response); imageurl = response.data[0].link; if (imageurl == "") $( "#images" ).attr('src', "imageerror.jpg"); else $( "#images" ).attr('src', imageurl); }, "json");
But this will not work because the website does not allow cross domain (unless you own it and do not allow your website).
source share