буду благодарен за любую помощь.
Код: Выделить всё
$(document).ready(function() {
$('#ajaxbtn').click(function() {
$.ajax({
url: 'https://www.easyprogramming.net/heroes.json',
method: 'GET',
success: function(data) {
let html = 'IDTitle';
data.slice(0, 5).forEach(function(post) {
html += '' + post.id + '' + post.title + '';
});
html += '';
$('#ajax-content').html(html);
}
});
});
});
AJAX Button
Name
Superhero Name
City
Подробнее здесь: https://stackoverflow.com/questions/786 ... -ajax-call