Magento2 Error Uncaught SyntaxError: Unexpected token < in JSON at position 0
in the Ajax response
$.get(url, function(data) {
$('#load-more-loader').hide();
$('#load-more-product').show();
var myArray = JSON.parse(data);
var result = $(myArray.categoryProducts).find('.item.product.product-item');
var nxtUrl = $(myArray.categoryProducts).find('.next').attr('href');
$.each(result, function(index, value) {
$('.products.list.items.product-items').append(value);
$("form[data-role='tocart-form']").catalogAddToCart();
});
$('#load-more').hide();
if (typeof nxtUrl === "undefined") {
$('#load-more-product').html('<em>No More product in this Category.</em>');
} else {
$('.next').attr('href', nxtUrl);
}
});