xxxxxxxxxx
$(document).ready(function (){
$.ajax({
url: 'ajax_load.php',
type: "post",
data: "artist=<?php echo $artist; ?>",
dataType: 'html',
beforeSend: function() {
$('#current_page').append("loading..");
},
success: finished //Change to this
});
});
xxxxxxxxxx
$(document).ready(function() {
$.ajax({
url: "example.com/api/data",
method: "GET",
success: function(response) {
// Code to handle successful response
console.log(response);
},
error: function(xhr, status, error) {
// Code to handle error response
console.error(error);
}
});
});