$(document).ready(function() {
var owl = $('.owl-carousel');
owl.owlCarousel();
$.ajax('test.php').done(function (response) {
if (typeof response === 'string' && response.length > 0) {
$('.owl-carousel').html(response);
owl.trigger('refresh.owl.carousel');
} else {
console.log(response);
}
}).fail(function (jqXHR, textStatus, errorThrown) {
console.log(textStatus);
console.log(errorThrown);
});
});