The following code gets a value from an Ajax json call and should append it to a div with the corresponding value. Thing is, it appends as text, not as html, so I literally see my html as text on the page. How can I fix this?
$.ajax({
url: "https://domain.com/maprequest.php",
type: "POST",
dataType: 'json',
data: JSON.stringify(url_array),
crossDomain: true,
success: function(response) {
$.each(response, function(k, v) {
if (v != "") {
$('.offer-list li .img a')[k].append("<div class='hoverbox'><img src='" + v + "' alt='hover' /></div>");
}
});
}
});