jQuery API call
by Matthew Day
HTML
<div id="output"></div>
JavaScript
const url = 'https://www.omdbapi.com/';
const data = {
apikey: '58adaf1c',
s: 'office space',
r:'json'
};
var getStuff = (url, data, dostuff) => {
$.getJSON(url, data, dostuff);
}
var dostuff = response => {
console.log(response.Search[0].Title);
let output = document.getElementById('output');
$('#output').append('<img src="' + response.Search[0].Poster + '" />');
};
getStuff(url, data, dostuff);