The main aim is to change the background image of a DIV using AJAX.
$.getJSON("https://itunes.apple.com/search?term=" + searchTerm + '&limit=1' + '&callback=?',
function(data) {
$.each(data.results, function() {
var art = this.artworkUrl100;
$('.photo').parent().css('background-image', 'url(' + art + ')');
}
}
This is the HTML code:
<div id="results" class="photo"></div>